What is the difference between const int *ptr and int const
*ptr???

Answer Posted / manjunath

a) const int *ptr and
b) int const *ptr


Both actually mean the same...

Read from Right to left:
for(a):-> ptr is a pointer to an integer Constant and
for(b):-> ptr is a pointer to a constant integer...

..............
int *const ptr----------> ptr is a constant pointer to an
integer...

Is This Answer Correct ?    95 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the concepts involved in Object Oriented programming.

871


What is polymorphism in oops with example?

767


What is encapsulation process?

787


Can a destructor be called directly?

804


Write a program to sort the number with different sorts in one program ??

2110


What is inheritance write a program to show use of inheritance?

870


What is an interface in oop?

778


What is class and object with example?

816


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2377


What is the main feature of oop?

897


What type of loop is a for loop?

860


Which is not an object oriented programming language?

737


What is polymorphism in oop example?

733


Why do pointers exist?

877


Write a program to reverse a string using recursive function?

2026