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 / vignesh1988i

surely there is some difference.....

here 'a' is represented as array in which string gets stored
in consecutive locations......

p is a pointer variable where string is initilized... so in
p the base address of "literal " will get stored......

*p++ increments 'p' , but pertaining to some conditions.....
++ has more precedence than * , so first it will increment
the address and correspondingly it will show the value as *
precedes..... so after the increment the p points to 'i'...



thank u

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between far and near ?

1057


what is uses of .net

1688


Why is structure padding done in c?

1081


Is anything faster than c?

971


What is the purpose of clrscr () printf () and getch ()?

1031


how can I convert a string to a number?

1037


Why is sprintf unsafe?

1005


Can a pointer be null?

987


What is difference between Structure and Unions?

1193


Explain that why C is procedural?

1095


Can math operations be performed on a void pointer?

992


What is exit() function?

974


Why can’t we compare structures?

1231


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1737


What is nested structure with example?

1022