Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,470 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,983 people online right now. Registration is fast and FREE... Join Now!




Help me

 
Reply to this topicStart new topic

Help me

mr_anry
22 Jan, 2008 - 10:50 AM
Post #1

New D.I.C Head
*

Joined: 22 Jan, 2008
Posts: 3


My Contributions
i am using turbo c++ 4.5
how to represent the header file sstream
and
what is meant by
CreateDxf::~CreateDxf()
and how to present it in my turbo c++ 4.5
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Help Me
22 Jan, 2008 - 10:59 AM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
Could you give us some code to work with? Errors mean very little most of the time without a frame of reference.
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Help Me
22 Jan, 2008 - 11:11 AM
Post #3

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Turbo C++ apparently doesn't conform to the C++ standard. So instead of <sstream> use <strstream> and where you would normally use the functions istringstream and ostringstream you have to use istrstream and ostrstream.

The second part of your question is what is called a "destructor". It is a method fired when an object is destroyed and needs to be cleaned up. You can identify this because it looks just like the constructor except includes that tilde character "~".

For instance the example you show is the destructor function for the CreateDxf Object.

To implement it in your program would be just like any other function, but in a context where you have to clean up and free any resources on destruction of the object. This goes back to standard C++ theory. So look up the term "destructor" for more information on how they work.

Hope these answer your questions. Enjoy!

"At DIC we be the answer man, except the one that lurks in the shadows of your closet or under your bed!" ph34r.gif
User is offlineProfile CardPM
+Quote Post

Bench
RE: Help Me
22 Jan, 2008 - 12:09 PM
Post #4

D.I.C Addict
Group Icon

Joined: 20 Aug, 2007
Posts: 683



Thanked: 24 times
Dream Kudos: 150
Expert In: C/C++

My Contributions
As Martyr2 said, your compiler is too old to support <sstream>. The C++ language changed significantly in 1998/1999, and compilers which pre-date the standard are often missing out on a large number of language features.


The most up-to-date version of Turbo C++ is Turbo C++ Explorer 2006, which fully supports the C++ standard. you can download it for free from Borland's website
http://www.turboexplorer.com/cpp
User is offlineProfile CardPM
+Quote Post

nirvanarupali
RE: Help Me
22 Jan, 2008 - 06:45 PM
Post #5

D.I.C Stomach
Group Icon

Joined: 1 Aug, 2007
Posts: 994



Thanked: 4 times
Dream Kudos: 375
My Contributions
Where did you get that codes? Is it from here:

http://www.dreamincode.net/forums/showtopic37974.htm

If so, my codes has been compiled and tested by Borland 5.5 compiler which supports the latest ISO.

Use the updated version of your compiler.

As with regards with the constructor and destructor, I think Marty2 has said it already.

last, you need a good book to understand the class in C++.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 02:26PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month