This one's clever!
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/DVlEUy17gMgJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
You can put a label in while condition and then use goto label to print
hello.
#includestdio.h
int main()
{
goto vijay;
while ( 0)
{
vijay: printf(hello);
}
return 0;
}
Am i right..please reply..
On Wed, Sep 5, 2012 at 6:15 PM, Shashank Jain
also the keywords like int , long etc cannot be included in macro
On Wed, Sep 5, 2012 at 7:01 PM, Shashank Jain shashank29j...@gmail.comwrote:
thanks that was a really nice explanation
shashank
On Wed, Sep 5, 2012 at 6:48 PM, Bala cmb...@gmail.com wrote:
Source:
@vijay nice thought.
but actually the while loop has changed because of addition of label in it.
another possible answer could be write a cout hello; statement above
the main
but the problem given was enter into the loop without changing the loop.
On Wed, Sep 5, 2012 at 10:09 PM, SHOBHIT
Here is a question...and i am badly stuck at it
how would you get into the loop
int main()
{
while ( 0)
{
printf(hello);
}
return 0;
}
You cannot change the while loop and its condition and you have to print
hello
--
You received this message because you are
#define while(x) while(1)
Cheers,
-Bala
On Wed, Sep 5, 2012 at 7:45 AM, Shashank Jain shashank29j...@gmail.com wrote:
Here is a question...and i am badly stuck at it
how would you get into the loop
int main()
{
while ( 0)
{
printf(hello);
}
return 0;
}
it works
thanks for your reply
On Wed, Sep 5, 2012 at 6:19 PM, Bala cmb...@gmail.com wrote:
#define while(x) while(1)
Cheers,
-Bala
On Wed, Sep 5, 2012 at 7:45 AM, Shashank Jain shashank29j...@gmail.com
wrote:
Here is a question...and i am badly stuck at it
how would you get
Source: http://gcc.gnu.org/onlinedocs/cpp/Macros.html
You may define any valid identifier as a macro, even if it is a C
keyword. The preprocessor does not know anything about keywords. This
can be useful if you wish to hide a keyword such as const from an
older compiler that does not understand
thanks that was a really nice explanation
shashank
On Wed, Sep 5, 2012 at 6:48 PM, Bala cmb...@gmail.com wrote:
Source: http://gcc.gnu.org/onlinedocs/cpp/Macros.html
You may define any valid identifier as a macro, even if it is a C
keyword. The preprocessor does not know anything about