LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2003, 08:10 AM   #1
cybercop12us
Member
 
Registered: Aug 2001
Posts: 60

Rep: Reputation: 15
what are c++ static constructors/destructors?


hi friends,

what are c++ static constructors/destructors? how to create it?

thanks,
harish
 
Old 01-20-2003, 02:00 PM   #2
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
class A {
int a;
public:
A(int i) {a=i;}
~A() {cout << "bye\n";}
};

A x(3); // Static constructor

main() {
// do stuff..
}
// static destructor of x called now.
 
Old 01-24-2003, 03:31 AM   #3
cybercop12us
Member
 
Registered: Aug 2001
Posts: 60

Original Poster
Rep: Reputation: 15
thanks for the reply friend. i could understand it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto Assign Multiple Static Public IP Addresses under SBC's PPPoE Static Ip system o trekgraham Linux - Networking 8 04-17-2007 10:51 AM
Is there any static ARP for static IP network? linux_lover2005 Linux - Networking 2 05-18-2005 12:01 PM
FC2 Overriding static if in favor of dhcp system set for static pkraus109 Linux - Networking 8 09-21-2004 11:13 AM
C++ - throwing exceptions in derived class constructors? MadCactus Programming 4 08-09-2004 06:29 AM
virtual destructors in C++ Komakino Programming 5 07-06-2004 03:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration