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

Answer Posted / abc

we cannot assign a string to another but we can assign a
char pointer to another char pointer.

Is This Answer Correct ?    23 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I write a function analogous to scanf?

661


What is a lookup table in c?

628


What are local static variables? How can you use them?

648


What is the use of a static variable in c?

595


What is void c?

569






What is multidimensional arrays

634


What is the role of this pointer?

550


How can I generate floating-point random numbers?

610


What is a pragma?

671


how to capitalise first letter of each word in a given string?

1435


How can I sort a linked list?

636


How do you determine the length of a string value that was stored in a variable?

652


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

714


Can we declare a function inside a function in c?

591


Why do we use static in c?

635