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
The statement, int(*x[]) () what does in indicate?
why wipro wase
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
What header files do I need in order to define the standard library functions I use?
What will the preprocessor do for a program?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is the difference between fread and fwrite function?
What are runtime error?
What are shell structures used for?
What is sizeof in c?
What are the 5 elements of structure?
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
Does c have an equivalent to pascals with statement?
What is the difference between procedural and declarative language?
Explain how can I manipulate strings of multibyte characters?