int main() { char *ptr = " Cisco Systems"; *ptr++; printf("%sn",ptr); ptr++; printf("%sn",ptr); getchar() return 0; } Click for Solution |
-
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A output will be
Cisco systems
isco system
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A the answer is
isco systemsn
sco systemsn
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A ther is \n
isco Systems
sco Systems
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A isco system
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A output will be not exactly as u r thinking, in printf there is no \n for new line, but its simply written %sn
output is correct : cisco system
isco system , if there would be an \n
if not then cisco syatemnisco system
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A Anser is :
Cisco Systems
isco Systems
*ptr plus plus means *(ptr=ptr plus 1); note : ( it's not *ptr=*ptr plus 1;)
and ptr plus plus; means ptr=ptr plus 1;
Thats why in both the cases pointer is increamented to one character forward.
note :plus symbol is not getting printed in command thats why i used "plus"
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A *ptr plus plus means *(ptr=ptr plus 1); note : ( it's not *ptr=*ptr plus 1;)
and ptr plus plus means ptr=ptr plus 1;
Thats why in both the cases pointer is increamented to one character forward.
note :plus symbol is not getting printed in command thats why i used "plus"
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A the answer is
Cisco Systems
isco Systems
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 664
Explore- GPL4you
- Home
- Prepdoor - Online Mock Test
- About
- FAQs
- Contact
- Contact Us
© 2011 - gpl4you | All Rights Reserved.
Cisco systems
isco systems