Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

Amusing C++: funny tricks

, 1 Nov 2011
Rate this:
Please Sign up or sign in to vote.
Try this one://Can we print all integers from 1 to 30??/int x = 0;while (x < 30){ _tprintf(_T("X = %d\n"), ++x);}

Try this one:

//Can we print all integers from 1 to 30??/
int x = 0;
while (x < 30)
{
  _tprintf(_T("X = %d\n"), ++x);
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Brett Rowbotham
Architect Knowledge Base Software
South Africa South Africa
No Biography provided

Comments and Discussions

 
QuestionMy vote of 5 PinprofessionalManikandan106-Jun-14 20:48 
GeneralReason for my vote of 1 for being a noob Pinmembermier10-Nov-11 5:46 
GeneralRe: Go look for a life somewhere else PinmemberBrett Rowbotham10-Nov-11 17:38 
GeneralYep, should have been _tprintf, been busy with safe string c... PinmemberBrett Rowbotham31-Oct-11 21:17 
GeneralRe: Oh you meant the comment! I deleted that when I tried it. I ... PinsubeditorIndivara31-Oct-11 22:28 
GeneralI suppose you meant to write _tprintf? (there's no _tsprintf... PinsubeditorIndivara31-Oct-11 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 1 Nov 2011
Article Copyright 2011 by Brett Rowbotham
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid