I have this file: example.hpp
Will Dev-Cpp (or any other compiler) accept this?: #include "cexample"
Thanks!!! 6 1352
On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@g mail.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.
W Marsh <wayneDOTmarshA TgmailDOTcom@> wrote in
news:9n******** *************** *********@4ax.c om: On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@g mail.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.
Andre Kostur wrote: W Marsh <wayneDOTmarshA TgmailDOTcom@> wrote in news:9n******** *************** *********@4ax.c om:
On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@g mail.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?
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.
Protoman wrote in message
<11************ *********@g49g2 000cwa.googlegr oups.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.so meslinkyextensi on" and do:
#include "myfunkybutt.so meslinkyextensi on"
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
"Protoman" <Pr**********@g mail.com> wrote in
news:11******** *************@g 49g2000cwa.goog legroups.com: Andre Kostur wrote: W Marsh <wayneDOTmarshA TgmailDOTcom@> wrote in news:9n******** *************** *********@4ax.c om:
> On 3 Dec 2005 13:45:29 -0800, "Protoman" <Pr**********@g mail.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.. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 dependency
explicit, or do just allow the include to be make implicitly through
the .h include? That is, should the header of your .cpp file be:
#include "CustomClass.h"
|
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?
|
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 the implementation of its
member functions in foo.cpp (which obviously #inludes foo.h) and further
assume that it depends on a class bar which is defined in bar.h.
It seems that there are the following two scenarios:
|
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>, Compiler gives an error.
What setting do I need to do such that, the latter syntax also accepted
for my headers ?
|
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 years, writes
medical software, which must ultimately pass FDA approval and ISO 9000
certification. The product the document applies to is a large system,
(just over 3 million lines of code) running on a variety of platforms
(all Unix-ish), and over...
| |
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:
=========================
typedef struct fubar
|
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 on the logged-in user's saved preferences.
The user can define their own styles (font-size, font-family, color, etc.)
|
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 the
instructions on c++-faq-lite), I get the same error, which is this:
invalid conversion from `int' to `DmtxDirection'
where DmtxDirection is an enum with integer values inside (obviously).
|
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 assuming this will be done
in the PreInit eventhandler, but i cannot find the right way to do this. Can
someone help me? Thanks.
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
|
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!
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |