Click here to Skip to main content
13,510,830 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 1 Nov 2011

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);


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


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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180417.1 | Last Updated 1 Nov 2011
Article Copyright 2011 by Brett Rowbotham
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid