473,508 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New style header files?

I have this file: example.hpp
Will Dev-Cpp (or any other compiler) accept this?: #include "cexample"
Thanks!!!

Dec 3 '05 #1
6 1346
On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@gmail.com>
wrote:
I have this file: example.hpp
Will Dev-Cpp (or any other compiler) accept this?: #include "cexample"
Thanks!!!


If the file cexample exists! What does example.hpp have to do with it?

#include does exactly what it says on the tin.
Dec 3 '05 #2
W Marsh <wayneDOTmarshATgmailDOTcom@> wrote in
news:9n********************************@4ax.com:
On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@gmail.com>
wrote:
I have this file: example.hpp
Will Dev-Cpp (or any other compiler) accept this?: #include "cexample"
Thanks!!!


If the file cexample exists! What does example.hpp have to do with it?

#include does exactly what it says on the tin.


The OP is probably getting confused with what:
#include <string.h>
and
#include <cstring>

Have to do with each other, and does it apply to user-supplied include
files (such as example.hpp).

Answer is... no, if you don't supply a file extension on the #include
statment, the compiler (or at least no compiler that I am aware of) will
not automatically add _anything_ to the filename. It will attempt to
include exactly the name you specified.
Dec 3 '05 #3

Andre Kostur wrote:
W Marsh <wayneDOTmarshATgmailDOTcom@> wrote in
news:9n********************************@4ax.com:
On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@gmail.com>
wrote:
I have this file: example.hpp
Will Dev-Cpp (or any other compiler) accept this?: #include "cexample"
Thanks!!!


If the file cexample exists! What does example.hpp have to do with it?

#include does exactly what it says on the tin.


The OP is probably getting confused with what:
#include <string.h>
and
#include <cstring>

Have to do with each other, and does it apply to user-supplied include
files (such as example.hpp).

Answer is... no, if you don't supply a file extension on the #include
statment, the compiler (or at least no compiler that I am aware of) will
not automatically add _anything_ to the filename. It will attempt to
include exactly the name you specified.


Then can I name the file "cexample"? and it'll work?

Dec 4 '05 #4
Protoman wrote:
The OP is probably getting confused with what:
#include <string.h>
and
#include <cstring>

Have to do with each other, and does it apply to user-supplied include
files (such as example.hpp).

Answer is... no, if you don't supply a file extension on the #include
statment, the compiler (or at least no compiler that I am aware of) will
not automatically add _anything_ to the filename. It will attempt to
include exactly the name you specified.


Then can I name the file "cexample"? and it'll work?


Yes.

Dec 4 '05 #5

Protoman wrote in message
<11*********************@g49g2000cwa.googlegroups. com>...

Then can I name the file "cexample"? and it'll work?


Did you try it?
(BTW: sex is spelled s e x, not c e x.)

You can name the file "myfunkybutt.someslinkyextension" and do:
#include "myfunkybutt.someslinkyextension"

Dev-C++ uses the MinGW port of GCC. Read the GCC docs to see which file
extensions have special meaning.
Look in the '*\include' directory for the 'C' headers.
Look in the '*\include\c++\<ver. number (3.3.1)>" for the 'C++' headers.
Go to the C++ includes directory and open the "cstring' header, you'll see
it refer to the 'string.h' C header, and do some stuff to make it work in C++
(if needed).

--
Bob R
POVrookie
Dec 4 '05 #6
"Protoman" <Pr**********@gmail.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:

Andre Kostur wrote:
W Marsh <wayneDOTmarshATgmailDOTcom@> wrote in
news:9n********************************@4ax.com:
> On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@gmail.com>
> wrote:
>
>>I have this file: example.hpp
>>Will Dev-Cpp (or any other compiler) accept this?: #include
>>"cexample" Thanks!!!
>
> If the file cexample exists! What does example.hpp have to do with
> it?
>
> #include does exactly what it says on the tin.
>


The OP is probably getting confused with what:
#include <string.h>
and
#include <cstring>

Have to do with each other, and does it apply to user-supplied
include files (such as example.hpp).

Answer is... no, if you don't supply a file extension on the #include
statment, the compiler (or at least no compiler that I am aware of)
will not automatically add _anything_ to the filename. It will
attempt to include exactly the name you specified.


Then can I name the file "cexample"? and it'll work?


Yes, but I'd wonder why you'd want to have an extensionless file....
it's generally handy to konw if a source file is intended to be used as
a header file or not..
Dec 4 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
1920
by: cppaddict | last post by:
Say that your CustomClass.h header files requires #include <string> Now say that your CustomClass.cpp file also requires string. Is it good form to repeat the <string> include to make the...
7
1640
by: Cameron Hatfield | last post by:
I was wondering how good this page of coding standards (http://www.doc.ic.ac.uk/lab/cplus/c++.rules/) is. Is it too outdated?
18
2222
by: Exits Funnel | last post by:
Hello, I'm a little confused about where I should include header files and was wondering whether there was some convention. Imagine I've written a class foo and put the definition in foo.h and...
14
2322
by: qazmlp | last post by:
If I include the headers(.h files) like #include "myHeader.h", in my implementation file(.C file), then 'myHeader.h' is properly included. But, when I include it like #include <myHeader.h>,...
15
1980
by: Earl Higgins | last post by:
The company where I work as a Senior Software Engineer is currently revamping their (1991 era) "Programming and Style Guidelines", and I'm on the committee. The company, in business for over 20...
18
1566
by: xarax | last post by:
Greetings, What is the general practice, usual and customary way, of including a data file into a source file? I have some large data structures defined as source similar to: ...
2
2151
by: Jason_SanDiego2006 | last post by:
Hello all, Hang with me, I'm a little new. I'm working on a web application in C# using ASP.NET 2.0 The goal of my application is to have pages whose styles can be dynamically changed based...
3
2269
by: Chris Cahoon | last post by:
Hello, I am trying to include a header file which was written in C, but my project is in C++. Even when I wrap the include statement or the entire header files with extern "C" (used according to...
4
1260
by: Nathan Sokalski | last post by:
I have a content page from which I need to add a style rule to be used by the page. Since content pages only have the content tags, I obviously need to edit the Master page's style using code. I am...
1
1547
by: Joe | last post by:
On Aug 5, 8:28 pm, Sjoerd <sjoer...@gmail.comwrote: That looks pretty promising, I'll give it a try, thanks!
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.