Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Printing String |
| Date | 2015-08-18 21:08 +1200 |
| Message-ID | <d3gavmF2rqoU2@mid.individual.net> (permalink) |
| References | <0be9b4e6-9eb0-4906-978f-25ef361bd70a@googlegroups.com> |
janus wrote:
> Hello All,
>
> printf("\nMy last card %s\n");
>
> From my understanding of C, the above should print "My last card "
> but I got "My last card Sample" . "Sample" was the last data my
> function worked on. Why this behavior?
First, please try and wrap your lines...
printf expected another parameter (to match the %s) and the text
"Sample" happened to be in memory where it expected the parameter to be.
--
Ian Collins
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Printing String janus <emekamicro@gmail.com> - 2015-08-18 01:52 -0700
Re: Printing String fir <profesor.fir@gmail.com> - 2015-08-18 02:06 -0700
Re: Printing String fir <profesor.fir@gmail.com> - 2015-08-18 02:12 -0700
Re: Printing String Ian Collins <ian-news@hotmail.com> - 2015-08-18 21:08 +1200
Re: Printing String Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-18 11:13 +0100
Re: Printing String Ian Collins <ian-news@hotmail.com> - 2015-08-19 07:20 +1200
Re: Printing String Bartc <bc@freeuk.com> - 2015-08-18 20:45 +0100
Re: Printing String Barry Schwarz <schwarzb@dqel.com> - 2015-08-18 13:21 -0700
Re: Printing String David Brown <david.brown@hesbynett.no> - 2015-08-19 09:05 +0200
Re: Printing String James Kuyper <jameskuyper@verizon.net> - 2015-08-19 10:25 -0400
Re: Printing String David Kleinecke <dkleinecke@gmail.com> - 2015-08-19 16:15 -0700
Re: Printing String Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-18 20:48 +0100
Re: Printing String David Brown <david.brown@hesbynett.no> - 2015-08-18 11:17 +0200
Re: Printing String Barry Schwarz <schwarzb@dqel.com> - 2015-08-18 09:05 -0700
csiph-web