#include "math.h" vs #include <cmath> [modified]</cmath>
-
Hi, What is the difference between
#include "math.h"
and#include
and which is better? Thanks & Regards, Sumanmodified on Friday, March 28, 2008 4:40 AM
first remove HTML support from your question! #include<math.h> search for file in path configured in project setting/development env setting #include "math.h" also search current directory including project/ developement env setting
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
-
first remove HTML support from your question! #include<math.h> search for file in path configured in project setting/development env setting #include "math.h" also search current directory including project/ developement env setting
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
ThatsAlok wrote:
#include "math.h" also search current directory including project/ developement env setting
Maybe a minor difference, using the quotes the searches first in the current directory and then in the project/ developement env setting. This means that you can overrule include files
codito ergo sum
-
first remove HTML support from your question! #include<math.h> search for file in path configured in project setting/development env setting #include "math.h" also search current directory including project/ developement env setting
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
-
Hi, Thanks for help. I actually meant "cmath", but it was deleted bacause of the tags. Thanks, Suman
ohh! CMATH header file is c99 compliant header file, see you don't use .h while including that file!, actually all the function under cmath header files comes under STD namespace!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
-
ThatsAlok wrote:
#include "math.h" also search current directory including project/ developement env setting
Maybe a minor difference, using the quotes the searches first in the current directory and then in the project/ developement env setting. This means that you can overrule include files
codito ergo sum
BadKarma wrote:
Maybe a minor difference, using the quotes the searches first in the current directory and then in the project/ developement env setting.
Right you say!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>
-
Hi, What is the difference between
#include "math.h"
and#include
and which is better? Thanks & Regards, Sumanmodified on Friday, March 28, 2008 4:40 AM
Hi, #include "....." is to include the files which are in your current working directory. For eg. if you have created some file which needs to be included in another cpp / c file for using a function or any member the you can use this option. if u have created a file a.cpp having some generalize function and you want to use this function in every other .cpp program then you can include this source code file in other source code using #include "a.cpp" #include <.....> is generally for dev/project Include folders which contains built-in .h files or any other files. :)
Regards SG (sgg245@yahoo.co.in)