const declarations and arrays 
Author Message
 const declarations and arrays

> int foo(const int *p);
> int foo(const int p[16]);
>or something similar.  Hope that helps!

It doesn't help because he wants to make clear that the array is
an array, and hence cannot be changed in foo(), whereas the
elements of the array are int variables that _can_ be changed
in foo(). Both suggested prototypes declare functions that take
pointers to "const int", not "const" pointers to "int".

| Kurt Watzka                             Phone : +49-89-2180-6254

Sun, 26 Apr 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. const declarations and arrays

2. Array of const pointers to const variable.

3. problem with array of const pointers to const data

4. Clean way to const-cast arrays of arrays?

5. How tightly does const bind within declaration?

6. const declarations in ANSI C

7. const convention in func prototypes/declarations

8. CONST after a function declaration

9. question on const declaration

10. extern const declaration

11. Const on a data declaration

12. const declaration


Powered by phpBB® Forum Software