what is constant pointer?

Answers were Sorted based on User's Feedback



what is constant pointer?..

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

what is constant pointer?..

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

what is constant pointer?..

Answer / srinivasroyal

A constant pointer is nothing which can not allow any
arthametic operations on it.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the code for getting the output as * ** ***

5 Answers   Caritor,


Why does notstrcat(string, "!");Work?

0 Answers  


What is Conio.h ?

2 Answers   TCS,


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); }

0 Answers   Wilco,


write a program to find the largest and second largest integer from an array

2 Answers   Value Labs,






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

5 Answers  


What is the symbol indicated the c-preprocessor?

0 Answers  


what is the different bitween abap and abap-hr?

0 Answers   TCS,


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); }

1 Answers   Vector,


Is it fine to write void main () or main () in c?

0 Answers  


What are identifiers and keywords in c?

0 Answers  


Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.

11 Answers   Microsoft,


Categories