Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a class struture to a typedef structure

Status
Not open for further replies.

simmeone

Programmer
Mar 16, 2000
29
DE
Hello,

I have a question, is it possible, to write a C++ class structure to a ANSI C typedef structure ? And what I have to heed ?

I have a class structure in this form:

class ODBC_Class
{
public:

HENV EnvHandle;
etc. ...

public:

ODBC_Class ( ); // Constructur
~ODBC_Class ( ); // Deconstructur

RETCODE ShowRes ( );
etc. ...
};


Is it possible to change this class to a ANSI C structure ?

Thanks for helping.

SiM
[sig][/sig]
 
It is possible, although classes and structures handle memory etc... completely differnetly. The definition of variables inside of structure is quite simple. However their is(as far as i know) no way to put a function inside of a structure. it may be possible, if you use a thing call a pointer to a function. bascially inside of your structure their would be a pointer of type void *. You then would allocate memory for a function. I think you can even typedef it(not positive) then pass the memory address to the pointer inside your structure.... I can not remember syntax, but look in this faq from my class in the faq section of the c forum.....

good luck [sig]<p>ackka<br><a href=mailto:tmoses@iname.com>tmoses@iname.com</a><br><a href= my site</a><br>"Do No Harm, Leave No Tracks"<br>
ICMP Summer 2000, 2600 Article<br>
<br>
[/sig]
 
i'm sorry, actualy look under the links section for the link called advanced c.zip....

later
[sig]<p>ackka<br><a href=mailto:tmoses@iname.com>tmoses@iname.com</a><br><a href= my site</a><br>"Do No Harm, Leave No Tracks"<br>
ICMP Summer 2000, 2600 Article<br>
<br>
[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top