Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COWould it be worthwhile to note what happens if multiple variables are specified in the same declaration? I believe `const int *foo,*bar;` would declare both `foo` and `bar` to be `int const *`, but `int const *foo, *bar` would declare `foo` to be a `int const *` and `bar` to be `int *`. I think `typedef int * intptr; const intptr foo,bar;` would declare both variables to be `int * const`; I don't know any way to use a combined declaration to create two variables of that type without a typedef.
      singulars
    2. CO@supercat `I believe const int *foo,*bar; would declare both foo and bar to be int const *`: Yes. `but int const *foo, *bar would declare foo to be a int const * and bar to be int *`: _No!_ It would be exactly the same as the previous case. (See http://ideone.com/RsaB7n where you get the same error for both foo and bar). `I think typedef int * intptr; const intptr foo,bar; would declare both variables to be int * const`: Yes. `I don't know any way to use a combined declaration to create two variables of that type without a typedef`: Well, `int *const foo, *const bar;`. C declarator syntax...
      singulars
    3. CO@gx_: So I was wrong--my uncertainty was why I suggested that it might be helpful to say what the rules are. What would `int const *foo, *volatile bar` do to `bar`? Make it both `const` and `volatile`? I miss Pascal's clean separation of declared-variable names and their types (a pointer to an array of pointers to integers would be `var foo: ^Array[3..4] of ^Integer`;`. That'd be some funny nested parenthesized thing in C, I think.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload