Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What type of question are asked in GE code writing test based on c++ data structures and pointers?

3980


Define the process of error-handling in case of constructor failure?

1016


When should overload new operator on a global basis or a class basis?

1081


write a porgram in c++ that reads an integer and print the biggest digit in the number

2256


Can we use clrscr in c++?

1082


Difference between class and structure.

1176


Will a catch statement catch a derived exception if it is looking for the base class?

1011


What is guard code in c++?

1171


What is token c++?

1028


Discussion on error handling of C++ .

1122


Why is c++ so fast?

1046


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1510


Describe protected access specifiers?

1231


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.

2174


Why do we use setw in c++?

1115