const char *
char * const
What is the differnce between the above two?
Answer Posted / p s
const char *s; is a non-const pointer to const char
char * const s; is a const pointer to non-const char
Once u assign a value to the const poinet it cannot be
reassigned another value till u use casting techniques..
char a = 'A';
char b = 'B';
char *const c = &a;
c = &b; //flags an errror
const char *s = &a;
s = &b //works
Is This Answer Correct ? | 19 Yes | 0 No |
Post New Answer View All Answers
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.
Explain dangling pointer.
Is there a c++ certification?
What can c++ be used for?
Why should you learn c++?
What is a dll entry point?
Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()
Can you pass an array to a function in c++?
By using c++ with an example describe linked list?
What is c++ map?
How do you print a string on the printer?
What is the difference between #import and #include?
Why can templates only be implemented in the header file?
How a modifier is similar to mutator?
What does it mean to declare a destructor as static?