Click here to Skip to main content
15,890,282 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
ZimFromIRK29-May-18 3:34
ZimFromIRK29-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
SeattleC++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
Jesse 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
jfbode102930-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
Jesse 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
PNutHed29-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
david 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
jfbode102930-May-18 3:58 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chad3F30-May-18 8:53
Chad3F30-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
code_junkie31-May-18 3:52 
GeneralLife back to normal Pin
lopatir25-May-18 22:52
lopatir25-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
lopatir26-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.