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
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is getch?
What is structure and union in c?
How do you generate random numbers in C?
Function calling procedures? and their differences? Why should one go for Call by Reference?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
What is a 'null pointer assignment' error?
What does c in a circle mean?
What is void c?
What is a static variable in c?
What is the meaning of && in c?
What are global variables?
Apart from dennis ritchie who the other person who contributed in design of c language.
I need previous papers of CSC.......plz help out by posting them.......
What do header files do?