Click here to Skip to main content
15,889,266 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: C declarations are half backward Pin
honey the codewitch30-Nov-20 6:24
mvahoney the codewitch30-Nov-20 6:24 
GeneralRe: C declarations are half backward Pin
BernardIE531730-Nov-20 8:38
BernardIE531730-Nov-20 8:38 
GeneralRe: C declarations are half backward Pin
Stuart Dootson30-Nov-20 5:53
professionalStuart Dootson30-Nov-20 5:53 
GeneralRe: C declarations are half backward Pin
Stuart Dootson30-Nov-20 5:52
professionalStuart Dootson30-Nov-20 5:52 
GeneralRe: C declarations are half backward Pin
honey the codewitch30-Nov-20 5:54
mvahoney the codewitch30-Nov-20 5:54 
GeneralRe: C declarations are half backward Pin
Member 1330167930-Nov-20 8:18
Member 1330167930-Nov-20 8:18 
GeneralRe: C declarations are half backward Pin
honey the codewitch30-Nov-20 8:26
mvahoney the codewitch30-Nov-20 8:26 
GeneralRe: C declarations are half backward Pin
Member 1330167930-Nov-20 8:49
Member 1330167930-Nov-20 8:49 
Quote:
I suppose then that I do not like that type modifiers are not declared with the type.


Pointers aren't type modifiers.

You can tell by the way that actual type modifiers can be placed in any order ("short int" and "int short") while the pointer notation can only go before the variable name.

short int si1;     // Compiles
int short si2;     // Compiles
short int *psi3;   // Compiles
*short int psi4;   // Error, won't compile.


If you do not associate the '*' with the variable name, then everything looks very confusing and arbitrary and some things that should work won't. If you associate the '*' with the variable name then everything is logical and can be worked out - any "*symbol" means that symbol is a pointer to something, so things like this can be worked out:

const char *varname[100];


You cannot logically infer what that means if you think that the "*" is part of the typename. If the "*" is part of the type, that would mean that the pointer can not be changed. In reality, it is the individual chars that cannot be changed, while each of the pointers in the array can be changed.

There's a lot of misunderstanding that will happen when "typename* varname" is used in place of "typename *varname". A compiler won't catch all of it.
GeneralRe: C declarations are half backward Pin
harold aptroot30-Nov-20 9:50
harold aptroot30-Nov-20 9:50 
GeneralRe: C declarations are half backward Pin
honey the codewitch30-Nov-20 10:10
mvahoney the codewitch30-Nov-20 10:10 
GeneralRe: C declarations are half backward Pin
BernardIE531730-Nov-20 21:46
BernardIE531730-Nov-20 21:46 
GeneralRe: C declarations are half backward Pin
harold aptroot1-Dec-20 1:33
harold aptroot1-Dec-20 1:33 
GeneralRe: C declarations are half backward Pin
BernardIE53171-Dec-20 7:30
BernardIE53171-Dec-20 7:30 
GeneralRe: C declarations are half backward Pin
Julie77730-Nov-20 13:36
Julie77730-Nov-20 13:36 
GeneralRe: C declarations are half backward Pin
BernardIE531730-Nov-20 22:41
BernardIE531730-Nov-20 22:41 
GeneralRe: C declarations are half backward Pin
mike@codeproject3-Dec-20 17:44
mike@codeproject3-Dec-20 17:44 
GeneralDo you know / trust this site? Pin
Nelek28-Nov-20 5:28
protectorNelek28-Nov-20 5:28 
GeneralRe: Do you know / trust this site? Pin
OriginalGriff28-Nov-20 6:25
mveOriginalGriff28-Nov-20 6:25 
GeneralRe: Do you know / trust this site? Pin
Nelek28-Nov-20 10:02
protectorNelek28-Nov-20 10:02 
GeneralRe: Do you know / trust this site? Pin
OriginalGriff28-Nov-20 10:15
mveOriginalGriff28-Nov-20 10:15 
GeneralRe: Do you know / trust this site? Pin
dandy7228-Nov-20 11:19
dandy7228-Nov-20 11:19 
GeneralRe: Do you know / trust this site? Pin
OriginalGriff28-Nov-20 11:33
mveOriginalGriff28-Nov-20 11:33 
GeneralRe: Do you know / trust this site? Pin
dandy7229-Nov-20 2:53
dandy7229-Nov-20 2:53 
GeneralRe: Do you know / trust this site? Pin
RedDk28-Nov-20 6:50
RedDk28-Nov-20 6:50 
GeneralRe: Do you know / trust this site? Pin
Cp-Coder28-Nov-20 7:24
Cp-Coder28-Nov-20 7:24 

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.