vippstar
9/1/2008 11:56:00 AM
On Sep 1, 1:58 pm, viza <tom.v...@gm-il.com.obviouschange.invalid>
wrote:
> Hi
>
> On Sun, 31 Aug 2008 23:27:48 -0700, Tinku wrote:
> > please forgive me if it is a stupid question because i dont understand
> > I saw a question in C -
>
> > if (____)
> > printf("welcome");
> > else
> > printf("to C world");
>
> > what should be the condition in if(___) for following output
>
> > welcome to C world
>
> You have had several answers, all correct, but none very useful, as is to
> be expected in comp.lang.c.
s/in comp.lang.c/with such vague specification.
> In answer to your question, it is not possible make both the if and the
> else happen, without using goto or something like that, which can get
> confusing.
>
> The answers from vippstar, Martin & August use a comma operator to make
> the evaluation of the ___ have a side effect of printing "welcome ", and
> then evaluate as false, causing "to C world" to be printed.
August did not use the comma operator.
> Remember that when joining strings together, you usually need to give one
> of them a space character where they meet.
Why?