What is a const pointer, and how does it differ from a pointer to a const?

Answer Posted / nashiinformaticssolutions

1. Pointer to const: The value being pointed to cannot be modified, but the pointer itself can change.
Example:
2. const int a = 10;
3. const int *ptr = &a; // *ptr is read-only
4. const pointer: The pointer cannot change, but the value it points to can.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of static variable in c?

811


how to make a scientific calculater ?

1788


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

797


Sir i need notes for structure,functions,pointers in c language can you help me please

2161


What is clrscr ()?

857


Explain what are global variables and explain how do you declare them?

834


Where are the auto variables stored?

847


What does %c do in c?

773


What is the stack in c?

885


What is a good data structure to use for storing lines of text?

818


Explain what are run-time errors?

810


What is methods in c?

822


What is the acronym for ansi?

800


Is it cc or c in a letter?

755


What are the advantage of c language?

758