what is constant pointer?
Answers were Sorted based on User's Feedback
Answer / rekha_sri
Constant pointer:
-----------------
If you have a value in your program and it should not
change, or if you have a pointer and you don't want it to be
pointed to a different value, you should make it a constant
with the const keyword.
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / srsabariselvan
constant Pointer:
we can't modify the value of pointer.i.e.,value of
pointer is constant.
Declaration:
int i=2,j;
int const *p;
p=&i;
p=&j;
Pointer Constant:
in case of Pointer constant, we can't modify the address of
pointer.i.e,address stored in pointer is constant.
This must be intialized
Declaration:
int i=2;
int *const p=&i;
*p=4;
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / srinivasroyal
A constant pointer is nothing which can not allow any
arthametic operations on it.
Is This Answer Correct ? | 0 Yes | 0 No |
what is the code for getting the output as * ** ***
Why does notstrcat(string, "!");Work?
What is Conio.h ?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
write a program to find the largest and second largest integer from an array
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed
What is the symbol indicated the c-preprocessor?
what is the different bitween abap and abap-hr?
main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }
Is it fine to write void main () or main () in c?
What are identifiers and keywords in c?
Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.