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

Why do we use stdio h and conio h?

0 Answers  


Given an unsigned integer, find if the number is power of 2?

5 Answers  


Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;

18 Answers   Accenture, Cisco, Egentec, HCL, Ideaz, Infosys, M-Systems, MYR, TCS,


#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output?

6 Answers   Ramco,


What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?

3 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


What does %c do in c?

0 Answers  


Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

0 Answers  


What's the right way to use errno?

0 Answers  


What is the size of enum in bytes?

0 Answers  


Why is #define used?

0 Answers  


How can I dynamically allocate arrays?

0 Answers  


Categories