Scoping question in C
pking123-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
pking123-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
Sun Jun 12 22:02:50 UTC 2005
> On Sun, 12 Jun 2005 pking123-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org wrote:
> Incidentally, the code as you showed it wouldn't even compile, since
> you wrote "#indlude" instead of "#include" once. This presumably
> means you retyped it rather than doing cut-and-paste or reading it
> from a file into your mail message. That's a bad idea, because typos
> can make major differences in how a program behaves; when asking about
> a programming problem, it's very important to show *exactly* the code
> you tried to run.
I pasted the program after playing around with it, but thought I
would go back to the original version that had return (EXIT_SUCCESS);
in the code. For that, I had to add #include <stdlib.h>, which I did
by hand, along with the return statement.
>
> > When I compiled your source code with a slight modification: single
> > quotes around the %s... I got 'something ' Note the \n came *before*
> > the closing quote in the output but not in the printf().
>
> That's peculiar, but I suspect that another typo might be at fault.
> I'm not going to try to diagnose this one without seeing the exact
> code.
That was my mistake. Quote should have been before the \n.
>
> Henry Spencer
> henry-lqW1N6Cllo0sV2N9l4h3zg at public.gmane.org
>
>
>
> --
> The Toronto Linux Users Group. Meetings: http://tlug.ss.org
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
>
>
> __________ NOD32 1.1136 (20050611) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
>
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list