C++ without Header files

How we can run our c++ program without header files?

Questions by vikas kushwah   answers by vikas kushwah

Showing Answers 1 - 24 of 24 Answers

Header files are files that contain definition for functions we use,for example: clrscr() which is a function used to clear the screen has its definition in conio.h.You can write a program without header files but it is very difficult as you have to give definition's for functions on your own.

  Was this answer useful?  Yes

archana kumari

  • Apr 4th, 2015
 

i have compiled program without header file in c then it is working ,but it is not working in c++.

what its correct answer

  Was this answer useful?  Yes

Gurg

  • Apr 6th, 2015
 

Seriously? That isnt true at all. What you are implying is that a program must include header files to provide ANY functionality for the main, aside from returning 0, as is customary. Strictly speaking, all including header files does is to textually replace the include line with the entire contents of the header file that was included. Thats it. Whats more, you can include cpp files (which are commonly known as "source" files). While this is strongly discouraged by just about anyone in their right mind, it IS possible.
If I REALLY wanted to, I could (assuming I got the source code) take the entirety of Microsoft Word 2010, for example, and shove it all in one, single cpp file. If I did everything correctly, the program should compile just fine.
I really fail to see the logic in how its "impossible" to compile any program without header files that isnt a main function with no body aside from returning 0...

  Was this answer useful?  Yes

harshit

  • Apr 14th, 2015
 

we can run c++ program without using header files by making the definition of all the functions and keywords in the programs

  Was this answer useful?  Yes

Eric Nantel

  • Apr 23rd, 2015
 

Put everything in the only cpp containing main()

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions