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

Answer Posted / mak

in case of array size of it become fixed after initialization,
so a string of length greater than the size of previous string can't be assigned to array.
on the other hand pointer can take variable size string as it stores only the first address.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a const pointer?

640


Is array a primitive data type in c?

581


Which one would you prefer - a macro or a function?

606


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4182


What is the difference between Printf(..) and sprint(...) ?

792






What does 3 mean in texting?

619


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

707


How do we print only part of a string in c?

587


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

4992


Using which language Test cases are added in .ptu file of RTRT unit testing???

3605


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

650


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

1932


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1747


What is a built-in function in C?

799


What is structure packing in c?

612