[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: c.jpg (60 KB, 798x1000)
60 KB
60 KB JPG
>int *const p, q; /* p constant, q not constant */
>int const p, q; /* both p and q are constant */
>there is no way to make only one of the variables const in a multi-declarator declaration unless the variable is a pointer
nice language faggots
>>
>int *p;
that declaration makes no sense anyways, it should be
int &p;
//or
&int p;

It's a andress
>>
>>106445174
somehow in thousands of hours of writing c, this has not only never caused me problems, it has never even come up at all. Isn't that strange?
>>
>>106445174
>using multi-declaration
>>
>>106445174
The first p is not constant.
>>
>>106445623
fpbp
>>
>>106445174
multi-line declaration should be removed from the language
>>
>>106445623
This
>>
>>106445174
>const int p, q;
2 const ints
>const int *p, q;
const int* and const int
>int *const p, q;
immutable pointer and int
>const int *const ywnbw;
you'll shit bricks when you see that
>>
>>106445174
>p is constant, points to int
>q is just an int
waaaow
>>
>>106445681
It is actually, but the value it's pointing at isn't.
const int p; // p is a constant int
const int *p; // p points to a constant int
const int * const p; // p is a constant pointer to a constant int
int * const p; // p is a constant pointer to a nonconstant int



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.