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...

main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs?

Answer Posted / chappa

The first increment is incorrect, since it will try to
increment the value of 'R' but will end up giving
Segmentation fault.

Second ptr++ is valid as it will shift the pointer from 'R'
to 'a'. The second print statement would have printed "amco
Systems", the compiler gives Seg fault due to the previous
incorrect increment.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain built-in function?

1146


What is the data segment that is followed by c?

1093


What are the 4 types of functions?

1061


What is sizeof in c?

1014


Is a pointer a kind of array?

1189


Explain the Difference between the New and Malloc keyword.

1143


What does dm mean sexually?

1323


What is scanf () in c?

1130


Is linux written in c?

1040


What is the use of a semicolon (;) at the end of every program statement?

1517


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

2076


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1135


What is a wrapper function in c?

1120


What is fflush() function?

1139


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1376