Static Variable and Static method

This is a discussion on Static Variable and Static method within the C++ Programming forums, part of the General Programming Boards category; Hello When i define a static variable in my code : static int Var; What is that mean static variable ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Static Variable and Static method

    Hello

    When i define a static variable in my code :

    static int Var;

    What is that mean static variable ?

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,261
    There are plenty of tutorials around that discuss static variables in C++. Easy to find with google, even for the lazy.
    Right 98% of the time, and don't care about the other 3%.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    26
    Hi grumpy
    Lazy to ask or Lazy to answer ??

  4. #4
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    Quote Originally Posted by codewriter View Post
    Lazy to ask or Lazy to answer ??
    Err..
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,261
    Quote Originally Posted by codewriter View Post
    Lazy to ask or Lazy to answer ??
    Lazy to ask.
    Right 98% of the time, and don't care about the other 3%.

  6. #6
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,545
    static has meany meanings. Google it, read it in a book, or research it some other way. Then come back with specific questions.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    and the hat of Marriage Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    178
    Quote Originally Posted by grumpy View Post
    Lazy to ask.
    Play-along anti-troll method successful.

    @OP - Google is the best C++ reference ever and will answer 80% of your questions before you have to come on a forum and ask "stupid" questions.

    Rodaxodictionary Reference
    Stupid Question - A question that has been answered 500,000 times each on 500,000 forums, which has been asked by a person with the laziness forte of a sloth <3
    How to ask smart questions

    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesWritten);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. static global variable and static extern global variable
    By gunjansethi in forum C Programming
    Replies: 8
    Last Post: 01-12-2011, 12:00 AM
  2. Replies: 8
    Last Post: 01-19-2009, 06:42 PM
  3. Replies: 6
    Last Post: 12-13-2007, 07:20 PM
  4. Static templated method problem
    By mikahell in forum C++ Programming
    Replies: 6
    Last Post: 11-19-2006, 08:19 AM
  5. call static method
    By geeoff in forum C++ Programming
    Replies: 1
    Last Post: 02-01-2002, 01:48 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21