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. Managed C++/CLI
  4. Static member variable in class?

Static member variable in class?

Scheduled Pinned Locked Moved Managed C++/CLI
question
2 Posts 2 Posters 2 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
    G Haranadh
    wrote on last edited by
    #1

    Is the static member variable in class will same for all objects of that class?


    Nice talking to you. :-O
    If you judge people, you have no time to love them. -- Mother Teresa

    S 1 Reply Last reply
    0
    • G G Haranadh

      Is the static member variable in class will same for all objects of that class?


      Nice talking to you. :-O
      If you judge people, you have no time to love them. -- Mother Teresa

      S Offline
      S Offline
      Shoaib Hussain
      wrote on last edited by
      #2

      yes static member variables are same for all objects of the class. As the scope of static member variable is class level not of object level. Each object of the class can access and share static member of class. Static member is accessed via class name and not by object name, like //static member accessment className.staticmember = someValue //object level variable. objName.objMember

      -shoaib-

      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