Posted: Sun Oct 28, 2007 2:38 pm Post subject: [C++] Question
C++ and visual C++ are different things?...
why in some tuts it says to write
#include <iostream>
and in others
#include <iostream.h>
?
please answer >.> _________________
Really there is no point to use iostream.h. Whenever it says to do that just put iostream instead. And visual C++ is just an IDE. It's basically the same, except it generates your form, and your controls for you. _________________
8D wrote:
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Mon Oct 29, 2007 4:10 am Post subject:
Figured you might want to know this as well.
There is a difference between using:
#include "iostream"
and
#include <iostream>
Using the quoted style means you are telling the preprocessor to look for your include file in the same directory that the calling file is located in. After it looks there, it then looks in any other file that is calling it and looks in their location as well. Afterward, the preprocessor will search directories that are specified by the /I compiler option. (MSVS compiler option, might be the same with others if they follow the same standards.) Then, it will scan all the folders that are listed in the INCLUDE environment variable.
Using the angle-bracet form tells the preprocessor to skip the local directory of the file thats calling the include and look inside the paths defined with the /I compiler option, then looks in the INCLUDE environment paths.
As for some files missing the .h, it's due to depreciation of unsafe versions. The new versions (the ones without the .h) are the 'safe' versions of the files that include extra security to prevent things like buffer overflows and such.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum