Re: [suse-programming-e] newbie questions - please help me get started
Örn Hansen wrote:
torsdag 01 april 2004 01:18 skrev du:
<snip>
These are "C" heders, and not C++ headers. Use their C++ counterpart, and for those you really need ...
extern "C" {
#include <dos.h>
};
#include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> or <cwctype> #include <ctime> #include <iostream> #include <cmath>
. . .
Thanks to all for their comments. I will give these suggestions a try. I was unaware that these were C and not C++ headers to I will start there. Thanks again, DC
On 2 Apr 2004 at 12:01, Darrell Cormier wrote: Date sent: Fri, 02 Apr 2004 12:01:45 -0600 From: Darrell Cormier <linuxdev@sptc.net> To: suse-programming <suse-programming-e@suse.com> Subject: Re: [suse-programming-e] newbie questions - please help me get started [snip...]
These are "C" heders, and not C++ headers. Use their C++ counterpart, and for those you really need ...
extern "C" {
#include <dos.h>
};
#include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> or <cwctype> #include <ctime> #include <iostream> #include <cmath>
Thanks to all for their comments. I will give these suggestions a try. I was unaware that these were C and not C++ headers to I will start there.
Thanks again, DC
There is one other thing you should be aware of. When you use the <xxx.h> variant it brings everything in the file into the global namespace, and you can just access it exactly as you would in 'C'. When you use the <cxxx> variant it brings all the stuff in the file into the std namespace, not the global namespace. This means that to access anything in the file you need to do one of two things - either prefix the name with 'std::' (eg std::printf()) or add a line after the includes saying 'using namespace std;'. The latter will move the contents of the include files into the global namespace. I use the 'std::' option, because I like to keep the global namespace as clean as possible, but I know most people prefer the 'using' declaration. alan -- http://www.ibgames.net/alan Registered Linux user #6822 http://counter.li.org Winding Down - Weekly Tech Newsletter - subscribe at http://www.ibgames.net/alan/winding/mailing.html
participants (2)
-
alan@ibgames.com
-
Darrell Cormier