Click here to Skip to main content
15,895,799 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 4:53
User 1106097926-May-18 4:53 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Richard MacCutchan26-May-18 5:17
mveRichard MacCutchan26-May-18 5:17 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
User 1106097926-May-18 5:21
User 1106097926-May-18 5:21 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Gerry Schmitz29-May-18 6:59
mveGerry Schmitz29-May-18 6:59 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Ron Anders26-May-18 3:25
Ron Anders26-May-18 3:25 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jschell26-May-18 6:33
jschell26-May-18 6:33 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
lopatir26-May-18 8:51
lopatir26-May-18 8:51 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
jschell9-Jun-18 5:35
jschell9-Jun-18 5: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.

C++
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? PinPopular
PIEBALDconsult26-May-18 7:30
mvePIEBALDconsult26-May-18 7:30 
PraiseRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
CPallini26-May-18 11:02
mveCPallini26-May-18 11:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
david garlisch29-May-18 16:47
david garlisch29-May-18 16:47 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PIEBALDconsult30-May-18 5:56
mvePIEBALDconsult30-May-18 5:56 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder26-May-18 7:48
cofounderChris Maunder26-May-18 7:48 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
lopatir26-May-18 8:55
lopatir26-May-18 8:55 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder26-May-18 10:27
cofounderChris Maunder26-May-18 10:27 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Member 966767828-May-18 22:02
Member 966767828-May-18 22:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PhM3329-May-18 3:35
professionalPhM3329-May-18 3:35 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Gary Wheeler29-May-18 3:56
Gary Wheeler29-May-18 3:56 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder29-May-18 9:04
cofounderChris Maunder29-May-18 9:04 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
PhM3330-May-18 12:10
professionalPhM3330-May-18 12:10 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Chris Maunder30-May-18 13:34
cofounderChris Maunder30-May-18 13:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
kalberts30-May-18 21:34
kalberts30-May-18 21:34 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Jon McKee26-May-18 9:28
professionalJon McKee26-May-18 9:28 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
JesperMadsen12328-May-18 20:02
JesperMadsen12328-May-18 20:02 
GeneralRe: Why does most C/C++ developer prefers char *c instead of char* c? Pin
Grand Chain28-May-18 21:13
Grand Chain28-May-18 21: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.