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. How to know the type of variable at run time??

How to know the type of variable at run time??

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelptutorial
4 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.
  • A Offline
    A Offline
    ashishbhatt 0
    wrote on last edited by
    #1

    Hi All, I am using VC++ MFC Application. I want to know the typeof my variable at run time, how can I do that? I hope it is possible with the typeof operator, but it gives me error like this identifier not found.So, is it possible with VC++ to use something like typeof operator?? Thanks in Advance.

    Ashish Bhatt

    M N M 3 Replies Last reply
    0
    • A ashishbhatt 0

      Hi All, I am using VC++ MFC Application. I want to know the typeof my variable at run time, how can I do that? I hope it is possible with the typeof operator, but it gives me error like this identifier not found.So, is it possible with VC++ to use something like typeof operator?? Thanks in Advance.

      Ashish Bhatt

      M Offline
      M Offline
      mr_Tuborg
      wrote on last edited by
      #2

      Try to see 'CRuntimeClass' in the MSDN Library. Good luck ;)

      1 Reply Last reply
      0
      • A ashishbhatt 0

        Hi All, I am using VC++ MFC Application. I want to know the typeof my variable at run time, how can I do that? I hope it is possible with the typeof operator, but it gives me error like this identifier not found.So, is it possible with VC++ to use something like typeof operator?? Thanks in Advance.

        Ashish Bhatt

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        ashishbhatt wrote:

        I hope it is possible with the typeof operator

        Where is that function? Or did u mean typeid()?

        nave [OpenedFileFinder]

        1 Reply Last reply
        0
        • A ashishbhatt 0

          Hi All, I am using VC++ MFC Application. I want to know the typeof my variable at run time, how can I do that? I hope it is possible with the typeof operator, but it gives me error like this identifier not found.So, is it possible with VC++ to use something like typeof operator?? Thanks in Advance.

          Ashish Bhatt

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Run-Time Type Information[^]

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          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