Click here to Skip to main content
14,829,679 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
baemayr29-May-18 3:34
Memberbaemayr29-May-18 3:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
SeattleC++29-May-18 4:32
MemberSeattleC++29-May-18 4:32 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jesse Connell29-May-18 6:03
MemberJesse Connell29-May-18 6:03 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jfbode102930-May-18 10:46
Memberjfbode102930-May-18 10:46 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jesse Connell30-May-18 17:31
MemberJesse Connell30-May-18 17:31 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PNutHed29-May-18 6:05
MemberPNutHed29-May-18 6:05 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
englebart29-May-18 11:27
professionalenglebart29-May-18 11:27 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
ClockMeister29-May-18 13:19
professionalClockMeister29-May-18 13:19 
.jpg wrote:
char is a type and c is a name, to me, it always make more sense to put the name alone and have the type together, like "char* c", I can tell immediately that it is a pointer to a char, so its always goes like [type] [name].

But in contrast, most C/C++ code I found prefer the other way around, like "char *c". Is there any specific reasons why this is so?


My guess is that most C programmers hail from the K&R (Kernighan and Ritchie) days and I believe that char *c is the form they would have used. (I lost my dear old K&R years ago). Beyond that, it's probably just personal habit.
If you think hiring a professional is expensive, wait until you hire an amateur! - Red Adair

GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
david garlisch29-May-18 16:59
Memberdavid garlisch29-May-18 16:59 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jfbode102930-May-18 3:58
Memberjfbode102930-May-18 3:58 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chad3F30-May-18 8:53
MemberChad3F30-May-18 8:53 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
code_junkie31-May-18 3:52
Membercode_junkie31-May-18 3:52 
GeneralLife back to normal Pin
lopatir25-May-18 22:52
Memberlopatir25-May-18 22:52 
GeneralRe: Life back to normal Pin
RickZeeland26-May-18 0:17
mveRickZeeland26-May-18 0:17 
GeneralRe: Life back to normal Pin
OriginalGriff26-May-18 0:31
mveOriginalGriff26-May-18 0:31 
GeneralRe: Life back to normal Pin
RickZeeland26-May-18 0:37
mveRickZeeland26-May-18 0:37 
GeneralRe: Life back to normal Pin
OriginalGriff26-May-18 1:10
mveOriginalGriff26-May-18 1:10 
GeneralRe: Life back to normal Pin
lopatir26-May-18 2:27
Memberlopatir26-May-18 2:27 
GeneralLow profile Pin
RickZeeland25-May-18 20:30
mveRickZeeland25-May-18 20:30 
GeneralRe: Low profile Pin
CPallini25-May-18 21:14
mveCPallini25-May-18 21:14 
GeneralRe: Low profile Pin
RickZeeland25-May-18 22:17
mveRickZeeland25-May-18 22:17 
GeneralRe: Low profile Pin
CPallini25-May-18 22:47
mveCPallini25-May-18 22:47 
GeneralRe: Low profile Pin
OriginalGriff25-May-18 21:32
mveOriginalGriff25-May-18 21:32 
GeneralRe: Low profile Pin
RickZeeland25-May-18 22:21
mveRickZeeland25-May-18 22:21 
JokeRe: Low profile Pin
Daniel Pfeffer26-May-18 9:00
professionalDaniel Pfeffer26-May-18 9:00 

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.