using namespace std;
class Static
{
private:
static vector values;
public:
Static ()
{
vector::iterator b = values.begin ();
for (; b != values.end (); b++)
{
cout << *b << endl;
}
}
class VectorInitializer
{
public:
VectorInitializer ()
{
Static::values.push_back (20);
Static::values.push_back (40);
Static::values.push_back (60);
}
};
friend class Static::VectorInitializer;
};
vector
Static::values;
static
Static::VectorInitializer
initalizer; //initializes the vector.
int
main (void)
{
Static
x;
}
Sunday, March 26, 2006
Gopal's static block example
Gopal's example at C++ Static Blocks with better syntax highlighting.
Subscribe to:
Post Comments (Atom)
privacy
Some of the policy from the app automation refers to https://rclone.org/privacy/ if you are a general blog reader, follow Google's polic...
-
I received my MS degree from BITS Pilani today. Wow! I am now qualified to do more, I feel so energized. As I am writing this blog, I look ...
-
I reviewed a chapter of Computer Organization & Architecture, Designing for Performance. This is the last of my reviews for a long time ...
-
I still remember meeting a great architect at a place I worked. He was very humble and so good that he was a role model. Basically whether w...
2 comments:
This is awesome!
How can I do it?
Well, it is straight forward.
1. Download gvim
2. Enable Syntax Highlighting
3. Export to html
4 cut-copy-paste the html
Open source rocks :-)
Post a Comment