Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?

Answer Posted / bee

logically, both are treated as array of characters(i.e.
string) but....

1) a is an array of characters(a string)

2) p is a pointer to an array of characters
the statement char *p = "literal" is equivalent to
char j[] = "literal"
char *p = j;
3) *p++ can be seen as *(p++)....
this is so because '++' has higher recedence over '*'
operator. so, it increments address by 1 unit and prints
the corresponding value value

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate Source Codes from Object Codes

1656


Does c have circular shift operators?

1295


Do you know what are the properties of union in c?

1131


How can you increase the allowable number of simultaneously open files?

1207


What is pass by reference in functions?

904


What are the loops in c?

1046


how to count no of words,characters,lines in a paragraph.

4470


Calculate 1*2*3*____*n using recursive function??

2095


Explain the difference between exit() and _exit() function?

1208


What is formal argument?

1189


What is a void pointer in c?

1153


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2124


If the size of int data type is two bytes, what is the range of signed int data type?

1070


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1326


What is the difference between union and structure in c?

1274