What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / karuna
a[] is a constant pointer to a string;
char *p is a pointer to a constant string;
In a[] address of a[] cant be change but string can be
change.
In char *p address can be change string cant be change
Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
Where are c variables stored in memory?
Can we replace the struct function in tree syntax with a union?
Difference between linking and loading?
Should a function contain a return statement if it does not return a value?
What are the advantages of using new operator as compared to the function malloc ()?
What is variables in c?
What is indirection?
Explain what standard functions are available to manipulate strings?
Why do we use null pointer?
What does the file stdio.h contain?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
Wt are the Buses in C Language
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What are preprocessor directives in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list