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

What is c programing language?

1134


What are the types of i/o functions?

1420


What is c system32 taskhostw exe?

1071


What is difference between arrays and pointers?

1151


Are there constructors in c?

1060


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

1218


can any one tel me wt is the question pattern for NIC exam

2025


What is #line used for?

1072


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2062


Do array subscripts always start with zero?

1370


How do I swap bytes?

1121


Is void a keyword in c?

1053


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3309


Write a program of prime number using recursion.

1128


Why calloc is better than malloc?

1093