cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
how to include header file
how to include header file
Jan 12, 2013 at 12:31pm UTC
azmizryk
(41)
i want to include a header file which is in the same directory of source file..i am using visual c++2010..
Jan 12, 2013 at 12:37pm UTC
Peter87
(11178)
Can't you just do
#include "name_of_header_file.h"
?
Jan 12, 2013 at 1:04pm UTC
azmizryk
(41)
I tried this as #include<header.h>
bt its not working...
Jan 12, 2013 at 1:26pm UTC
Fransje
(435)
You first have to add it to your project. In the Solution Explorer rightclick 'Header Files'->Add->Existing Item, then find your header file and double click it.
#include "name_of_header_file.h"
should work now.
Jan 12, 2013 at 1:45pm UTC
Stewbond
(2827)
You shouldn't actually need to add it to your solution. Just include with quotes instead of with <>.
Jan 12, 2013 at 2:58pm UTC
azmizryk
(41)
working as
#include"name.h"
thanks to all.
Topic archived. No new replies allowed.