What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / ashok
Pointers are fine a cannot be changed p can be changed.
I have a doubt like is there any difference in memory
allocation.
I heard like a gets its memory in local stack and p gets in
data section.
I don get the clear explanation
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What are header files and what are its uses in C programming?
What is indirection in c?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is FIFO?
what is reason of your company position's in india no. 1.
How do you view the path?
In a switch statement, what will happen if a break statement is omitted?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What are the different types of C instructions?
Why header file is used in c?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What are the difference between a free-standing and a hosted environment?
What does a pointer variable always consist of?