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...

What is the difference between char a[] = "string"; and
char *p = "string"; ?

Answer Posted / kurvatis

When a program starts its content copies from external
memory like a hard drive to a PROTECTED from writes part of
RAM. No any byte in that area can be changed!

Now the difference.
char * p = "this string is in protected memory and cannot be
changed";
You cannot change the string located in protected memory a
pointer points to.


char a[] = "this string is in memory that can be changed";

Theoretically char * p = "string"; eat less memory than
another one.

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The statement, int(*x[]) () what does in indicate?

1205


why wipro wase

2367


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

2230


What header files do I need in order to define the standard library functions I use?

1120


What will the preprocessor do for a program?

1117


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3334


What is the difference between fread and fwrite function?

1133


What are runtime error?

1178


What are shell structures used for?

1095


What is sizeof in c?

1055


What are the 5 elements of structure?

1130


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2755


Does c have an equivalent to pascals with statement?

1066


What is the difference between procedural and declarative language?

1190


Explain how can I manipulate strings of multibyte characters?

1257