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

Answer Posted / singamsa

we can not access a++ or a-- on array but we can do that in
pointers

array, address is constanct for that string, pointer is not
like that

Is This Answer Correct ?    43 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2583


What is mean by data types in c?

777


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4861


Where in memory are my variables stored?

864


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2179


Once I have used freopen, how can I get the original stdout (or stdin) back?

850


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

983


I came across some code that puts a (void) cast before each call to printf. Why?

981


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1860


Where is volatile variable stored?

857


swap 2 numbers without using third variable?

899


Tell me when is a void pointer used?

884


Explain the difference between malloc() and calloc() in c?

824


What is %g in c?

848


Can a pointer point to null?

806