| | |
Program without main()
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
>>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().
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().
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
>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 willfully clueless people.
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 willfully clueless people.
I'm here to prove you wrong.
•
•
Join Date: Jan 2008
Posts: 7
Reputation:
Solved Threads: 2
Every 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 a non-standard environment, then the answer is it depends on the environment.
So, the answer is: in ISO Standard C/C++, you cannot print anything without having a main() function. If you are talking about a non-standard environment, then the answer is it depends on the environment.
•
•
Join Date: May 2009
Posts: 3
Reputation:
Solved Threads: 0
Ok the question asked is never print anything without main() function. The question asked is without anything in main function and it is possible(I know it because i myself have asked this question many times). You can do just about anything without anything inside main() function. The answer is C++ -> class -> global object. Try it and you'll see.
Last edited by abhishekp; May 26th, 2009 at 11:35 am.
![]() |
Other Threads in the C++ Forum
- Previous Thread: array to file
- Next Thread: Messing up stringstream
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





