Thread: Static Variable and Static method

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

    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,815
    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%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

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

  4. #4
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by codewriter View Post
    Lazy to ask or Lazy to answer ??
    Err..

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    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%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    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,&dwBytesOverwritten);

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, 01:00 AM
  2. Replies: 8
    Last Post: 01-19-2009, 07:42 PM
  3. Replies: 6
    Last Post: 12-13-2007, 08:20 PM
  4. Static templated method problem
    By mikahell in forum C++ Programming
    Replies: 6
    Last Post: 11-19-2006, 09:19 AM
  5. call static method
    By geeoff in forum C++ Programming
    Replies: 1
    Last Post: 02-01-2002, 02:48 PM