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
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
Can I initialize unions?
How is a pointer variable declared?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
When we use void main and int main?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Explain the priority queues?
praagnovation
What is the best way of making my program efficient?
What is #include called?
Is boolean a datatype in c?
What are loops in c?
Why is c called a mid-level programming language?
Can you return null in c?
Is there any possibility to create customized header file with c programming language?