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. static variable issue!

static variable issue!

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionworkspace
5 Posts 3 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.
  • G Offline
    G Offline
    ganesa moorthy
    wrote on last edited by
    #1

    Hi, I have created a static variable in a vc++6.0 project, the same project has sub project workspace. The variable which was created in one workspace is not accessible in another, though all are successfully compiled. what could be the reason ? Thanks and regards, :)

    Thanks a lot

    L M 2 Replies Last reply
    0
    • G ganesa moorthy

      Hi, I have created a static variable in a vc++6.0 project, the same project has sub project workspace. The variable which was created in one workspace is not accessible in another, though all are successfully compiled. what could be the reason ? Thanks and regards, :)

      Thanks a lot

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      ganesa moorthy wrote:

      what could be the reason ?

      The reason is that you were absent the day they taught C++ in C++ class. That's a C++ basic beginners topic (static scope[^]) and if you have not yet learned it then I hope your project is a school project.

      led mike

      G 1 Reply Last reply
      0
      • G ganesa moorthy

        Hi, I have created a static variable in a vc++6.0 project, the same project has sub project workspace. The variable which was created in one workspace is not accessible in another, though all are successfully compiled. what could be the reason ? Thanks and regards, :)

        Thanks a lot

        M Offline
        M Offline
        Michael Schubert
        wrote on last edited by
        #3

        You really have to get yourself a book about C/C++ basics.

        G 1 Reply Last reply
        0
        • L led mike

          ganesa moorthy wrote:

          what could be the reason ?

          The reason is that you were absent the day they taught C++ in C++ class. That's a C++ basic beginners topic (static scope[^]) and if you have not yet learned it then I hope your project is a school project.

          led mike

          G Offline
          G Offline
          ganesa moorthy
          wrote on last edited by
          #4

          try it in two different workspaces, it will work within one workspace only.

          Thanks a lot

          1 Reply Last reply
          0
          • M Michael Schubert

            You really have to get yourself a book about C/C++ basics.

            G Offline
            G Offline
            ganesa moorthy
            wrote on last edited by
            #5

            thanks i need to learn a lot, but do u know it is possible to retain and have values of static variable in project but across workspaces.

            Thanks a lot

            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