Re: A question on variable defination



sunnylele wrote:

Hi, all,

a question on the following defination:
an external function is defined as:
nmriopen(char *const filename, const int np1, const float step1,
const int np2, const float step2)

what's the difference if it is defined as:
nmriopen(char filename, int np1, float step1,
int np2, float step2)

and what if use "int *const np1" instead of "const int np1"?

const qualified arguments
don't mean anything to the function caller.
const qualified arguments
only affect the way that the function definition must be written.

--
pete
.



Relevant Pages

  • A question on variable defination
    ... nmriopen(char *const filename, const int np1, const float step1, ... const int np2, const float step2) ...
    (comp.lang.c)
  • Re: to const or not to const
    ... Does it help to declare integer function arguments as const? ... const int func ... The parameter 'const float *f' means that what the ...
    (comp.lang.c)
  • Re: Is this legal?
    ... That it is the only way to initialise an 'const' ... | online Comeau snippet compiler. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: accessor member functions and const
    ... I want to be able to reference the returned ... const int& getValconst ... so one cannot modify the object via the reference. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: const bei Parametern egal?
    ... void bar (const int i); ... hatte ich eigentlich eine Compiler-Fehlermeldung wegen des fehlenden const in der Definition von foo::barerwartet. ... the const and volatile typespecifiers ... for each parameter type are ignored ...
    (microsoft.public.de.vc)