Click here to Skip to main content
12,630,420 members (29,739 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

6.1K views
1 bookmarked
Posted

Amusing C++: funny tricks

, 1 Nov 2011 CPOL
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

You may also be interested in...

Comments and Discussions

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

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web02 | 2.8.161205.3 | Last Updated 1 Nov 2011
Article Copyright 2011 by Brett Rowbotham
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid