Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi
I want to know everything about static things in c++ . I have searched it but most of results are about static values !

I want to know about static classes or functions and making an instance of them and approach to use them .

Thanks a lot dears!
Posted

Did you go through you academic book before you write down this question?
there are different sources where you can find about the static class, function and values.
Make sure you go through the book of
Quote:
E. Balagurusamy
or go through this site to get this book and study in detail.
http://books.google.com.np/books/about/Object_Oriented_Programming_With_C++.html?id=TN9wQjjDwp0C&redir_esc=y[^]
Even after this, if you have got more queries then you are free to ask.
Thank you.
 
Share this answer
 
1) Static variable = global variable but visible only in target function or structure or class. So value of static variable is not delete.

2) Static member of class or structure = global variable for all objects of the class. For example for count objects of the class.

C++
class MyClass{
 static int counter;
};


You can call

C++
MyClass::counter++;
 
Share this answer
 
If you really want to learn about C++ then this is the place to start[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900