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

Answer Posted / glibwaresoftsolutions

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 bss in c?

793


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1699


What is stack in c?

827


What is the difference between malloc calloc and realloc in c?

882


Why do we use stdio h and conio h?

841


How to declare pointer variables?

896


C program to find all possible outcomes of a dice?

2056


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

830


If null and 0 are equivalent as null pointer constants, which should I use?

803


What is a macro in c preprocessor?

837


application attempts to perform an operation?

1717


What is #include in c?

787


Can main () be called recursively?

866


What is calloc() function?

851


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

4191