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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. including C++ header file in .C file

including C++ header file in .C file

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
6 Posts 6 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.
  • S Offline
    S Offline
    Shailesh Ha
    wrote on last edited by
    #1

    Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

    P C CPalliniC V Z 5 Replies Last reply
    0
    • S Shailesh Ha

      Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      class is C++ keyword. Why you want to use it in C?

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      • S Shailesh Ha

        Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        You're speaking Dutch to a Frenchman. In other words, no .c file can contain a class. There are no classes in C.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        1 Reply Last reply
        0
        • S Shailesh Ha

          Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Shailesh Halankar wrote:

          how do i solve this?

          You cannot. :(

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          • S Shailesh Ha

            Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

            V Offline
            V Offline
            vijay_aroli
            wrote on last edited by
            #5

            Shailesh Halankar wrote:

            i include a header file of a class in a ".c" file

            is that what u said, or are we getting u wrong?? :confused: you are trying to use classes in C?? :omg: May be u are not explaining correctly i guess. :)

            vijay.

            1 Reply Last reply
            0
            • S Shailesh Ha

              Hello, when i include a header file of a class in a ".c" file ...i get error ... "class name" is undefined identifier. how do i solve this? amy clues? regards Shailesh

              Z Offline
              Z Offline
              Zac Howland
              wrote on last edited by
              #6

              Shailesh Halankar wrote:

              when i include a header file of a class in a ".c" file

              You make your file a .cc, .cpp, or .cxx file ;P

              If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

              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