Is it possible to print anything on screen in C or C++ without using main().If yes please explain how?
rukunaditya 0 Newbie Poster
Recommended Answers
Jump to Post— William Hemsworth 1,339main() is the start of any C++ application, why do you need to do it without it ?
Jump to Post— Salem 6,009Because it's a frequent teaser question which some tutors think are useful in some way.
Like for example printing without using a ; or making the program print it's source code or some other dumb trick.
Jump to Post— Ancient Dragon 5,243>>Is it possible to print anything on screen in C or C++ without using main().
Yes -- write a MS-Windows win32 api program which uses WinMain() instead of main(). Or use VC++ 2008 and it will generate a console program that starts with _tmain().
Jump to Post— Narue 5,707>So please help
Try searching for WinMain on www.google.com. Seriously, it's not that hard to do a little bit of research and come up with something. We tend not to take kindly to …
Jump to Post— eager 8Every ISO standard C/C++ program must have a main(). Windows, other graphic environments, and many embedded systems have a non-standard environment and may not need a main().
So, the answer is: in ISO Standard C/C++, you cannot print anything without having a main() function. If you are talking about …
All 20 Replies
William Hemsworth 1,339 Posting Virtuoso
rukunaditya 0 Newbie Poster
Salem 6,009 Posting Sage
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
rukunaditya 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
eager 8 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
abhishekp -5 Newbie Poster
jephthah commented: insipid -2
tux4life commented: 1 year too late!! and useless post! -1
William Hemsworth commented: Good answer, but late. -2
MariaERamos 7 Newbie Poster
ArkM 1,090 Postaholic
MosaicFuneral 812 Nearly a Posting Virtuoso
ArkM 1,090 Postaholic
MariaERamos 7 Newbie Poster
abhishekp -5 Newbie Poster
ArkM 1,090 Postaholic
jloundy -5 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
jloundy -5 Newbie Poster
jephthah commented: schmuck. -2
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.