Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. #include "math.h" vs #include <cmath> [modified]</cmath>

#include "math.h" vs #include <cmath> [modified]</cmath>

Scheduled Pinned Locked Moved C / C++ / MFC
questionvisual-studio
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rp_suman
    wrote on last edited by
    #1

    Hi, What is the difference between #include "math.h" and #include and which is better? Thanks & Regards, Suman

    modified on Friday, March 28, 2008 4:40 AM

    T S 2 Replies Last reply
    0
    • R rp_suman

      Hi, What is the difference between #include "math.h" and #include and which is better? Thanks & Regards, Suman

      modified on Friday, March 28, 2008 4:40 AM

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      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" - Mixture

      cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

      B R 2 Replies Last reply
      0
      • T ThatsAlok

        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" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

        B Offline
        B Offline
        BadKarma
        wrote on last edited by
        #3

        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

        T 1 Reply Last reply
        0
        • T ThatsAlok

          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" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

          R Offline
          R Offline
          rp_suman
          wrote on last edited by
          #4

          Hi, Thanks for help. I actually meant "cmath", but it was deleted bacause of the tags. Thanks, Suman

          T 1 Reply Last reply
          0
          • R rp_suman

            Hi, Thanks for help. I actually meant "cmath", but it was deleted bacause of the tags. Thanks, Suman

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            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" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

            1 Reply Last reply
            0
            • B BadKarma

              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

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              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" - Mixture

              cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You/codeProject$$>

              1 Reply Last reply
              0
              • R rp_suman

                Hi, What is the difference between #include "math.h" and #include and which is better? Thanks & Regards, Suman

                modified on Friday, March 28, 2008 4:40 AM

                S Offline
                S Offline
                Sgg245
                wrote on last edited by
                #7

                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)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups