Click here to Skip to main content
14,775,702 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
User 1106097926-May-18 5:53
MemberUser 1106097926-May-18 5:53 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Richard MacCutchan26-May-18 6:17
mveRichard MacCutchan26-May-18 6:17 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
User 1106097926-May-18 6:21
MemberUser 1106097926-May-18 6:21 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Gerry Schmitz29-May-18 7:59
mveGerry Schmitz29-May-18 7:59 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Ron Anders26-May-18 4:25
MemberRon Anders26-May-18 4:25 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jschell26-May-18 7:33
Memberjschell26-May-18 7:33 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
lopatir26-May-18 9:51
Memberlopatir26-May-18 9:51 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jschell9-Jun-18 6:35
Memberjschell9-Jun-18 6:35 
Lopatir wrote:
The article you read was written by someone that either referred to a different programming language, or doesn't understand the C/C++ language definitions; char* is not a type in C/C++.


Far as I can recall it was a columnist in the C++ Programmers Journal. I suspect that they did in fact have a passing familiarity with the language. And since at least two columnists in that magazine participated in the C++ ANSI committee I suspect that their opinion on that subject of C++ would have carried more weight than any other random developer. They provided a rational for why that form was more appropriate which, far as I can recall, was not grounded solely in the semantics in the language but more in common usage of type specifiers. But I could certainly be mistaken about what they actually said.

Not to mention of course "The Annotated C++ Reference Manual" written by Ellis and Stroustrup which in section 4.7 has the following code examples.

void f(char* cptr, void* vptr)
...
int* p1 = 
...
char* cptr;
int* iptr;
void* vptr;


So seems like the creator of the language prefers that form as well.

My original usage was grounded in the form you are championing but that was based on K&R. I found the article I read persuasive enough that I started using the other form.
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PIEBALDconsult26-May-18 8:30
professionalPIEBALDconsult26-May-18 8:30 
PraiseRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
CPallini26-May-18 12:02
mveCPallini26-May-18 12:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
david garlisch29-May-18 17:47
Memberdavid garlisch29-May-18 17:47 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PIEBALDconsult30-May-18 6:56
professionalPIEBALDconsult30-May-18 6:56 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder26-May-18 8:48
cofounderChris Maunder26-May-18 8:48 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
lopatir26-May-18 9:55
Memberlopatir26-May-18 9:55 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder26-May-18 11:27
cofounderChris Maunder26-May-18 11:27 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Member 966767828-May-18 23:02
MemberMember 966767828-May-18 23:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PhM3329-May-18 4:35
professionalPhM3329-May-18 4:35 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Gary Wheeler29-May-18 4:56
MemberGary Wheeler29-May-18 4:56 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder29-May-18 10:04
cofounderChris Maunder29-May-18 10:04 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PhM3330-May-18 13:10
professionalPhM3330-May-18 13:10 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder30-May-18 14:34
cofounderChris Maunder30-May-18 14:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Member 798912230-May-18 22:34
MemberMember 798912230-May-18 22:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jon McKee26-May-18 10:28
professionalJon McKee26-May-18 10:28 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
JesperMadsen12328-May-18 21:02
MemberJesperMadsen12328-May-18 21:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Grand Chain28-May-18 22:13
MemberGrand Chain28-May-18 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.