c - What does the prototype "const int* foo(int)" mean,especially in contrast to "int* foo(int)"?I understand the second only -


i know int* foo(int) prototype means foo function takes integer argument , returns pointer integer.but following mean?

  const int* foo(int); 

i tried reason failed.my book doesn't see stuff in library function prototypes.so please tell me means.

so value pointed returned address can't change via address (useful when foo() returns address of const).

const int* p2c =  foo(int); *p2c=10;  <-- "error" 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -