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

Using which language Test cases are added in .ptu file of RTRT unit testing???

4271


How is = symbol different from == symbol in c programming?

1037


What is the function of this pointer?

1325


Explain can you assign a different address to an array tag?

1041


What is structure padding and packing in c?

1064


How can I ensure that integer arithmetic doesnt overflow?

1158


What is dangling pointer in c?

1212


What is typedef struct in c?

1044


what is the different bitween abap and abap-hr?

2312


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2637


please send me the code for multiplying sparse matrix using c

2166


Is flag a keyword in c?

1146


What is the difference between test design and test case design?

2083


What is the mean of function?

1122


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1199