Click here to Skip to main content
14,742,305 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
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 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jonas Hammarberg28-May-18 22:53
professionalJonas Hammarberg28-May-18 22:53 
If you always puts your declarations on separate lines (or separated by ';') it doesn't matter. But if you do -- be aware.

Say that you have;
char* c;
char* d;
char* e;

and, for some reason, probably even a good one, decides to put them on one line ... in a bit of hurry so that you ends up with;

char* c,d,e;

But if you had
char *c;
char *d;
char *e;

there is a pretty good chance you would end up with;
char *c, *d, *e;

This is also the reason for the typedef's of pointers, eg.
typedef char * char_p;
char_p c;
char_p d;
char_p e;

would be
char_p c, d, e;

rgds /Jonas

ps.

char* c, d, e; --> char* c; char d; char e;

GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
SawDid29-May-18 0:34
MemberSawDid29-May-18 0:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Member 798912229-May-18 2:23
MemberMember 798912229-May-18 2:23 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
SawDid29-May-18 10:32
MemberSawDid29-May-18 10:32 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Bob100029-May-18 0:39
professionalBob100029-May-18 0:39 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
tobofopo29-May-18 2:10
Membertobofopo29-May-18 2:10 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PIEBALDconsult30-May-18 7:02
professionalPIEBALDconsult30-May-18 7:02 
AnswerRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Hans Salvisberg29-May-18 2:15
MemberHans Salvisberg29-May-18 2:15 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Member 1014067829-May-18 2:47
MemberMember 1014067829-May-18 2:47 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Kirk 1038982129-May-18 2:59
MemberKirk 1038982129-May-18 2:59 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
nullusDefectus29-May-18 3:11
MembernullusDefectus29-May-18 3:11 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Hans Salvisberg29-May-18 4:20
MemberHans Salvisberg29-May-18 4:20 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
baemayr29-May-18 4:34
Memberbaemayr29-May-18 4:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
SeattleC++29-May-18 5:32
MemberSeattleC++29-May-18 5:32 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jesse Connell29-May-18 7:03
MemberJesse Connell29-May-18 7:03 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jfbode102930-May-18 11:46
Memberjfbode102930-May-18 11:46 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jesse Connell30-May-18 18:31
MemberJesse Connell30-May-18 18:31 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PNutHed29-May-18 7:05
MemberPNutHed29-May-18 7:05 

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.