Question:
what is the problem with header files?
MJ
2009-10-09 21:16:06 UTC
i am a beginner &i have just started working with classes.
On building or compiling my program,the compiler gave the error cannot open file studio.h ;I downloaded it from net an ran my program again.this time it gave error that basetypes.h file is missing
.
So whats th problem with header files?i mean is the Visual C++ i installed faulty that it does not include the basic header files?Also suggest me some useful sites for downloading basetypes.h header file

Please do reply quick
Four answers:
Anon
2009-10-09 21:30:08 UTC
1: The file is stdio.h, not studio.h

2: You are using library includes, so make sure you use the format #include NOT #include "header.h"

3: Make sure the PATH system variable is set properly.
The Phlebob
2009-10-09 21:38:27 UTC
Another point: Don't just download header files from whatever website happens to have them. They differ from compiler to compiler.



And Visual C++ should have installed all the header files it supports, including stdio.h and basetypes.h. Poke "#include directive" into the Index window (CTRL/ALT/F2) in the Integrated Development Environment.



Hope that helps.
Ratchetr
2009-10-09 21:35:12 UTC
Anon is quite right on all counts.

Let me add 1 more:



Don't just download some random stdio.h file from the net and expect it to work with your compiler. VC++ certainly does contain all the standard .h files, but you need to use the entire set they installed. You can't just mix and match, or you will end up in a death spiral.



Get rid of the file you downloaded, replace with original, and follow Anon's advice.
2016-04-07 05:24:04 UTC
You need to have the #include"employee.h> file in the C++ file with the main function and then you can declare the class employee #include #include #include #include "employee.h" using namespace std; int main() {employee Mydata; Mydata.getData(.......); Mydata.givepay(.....); Mydata.totalinfo(......); }


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...