Convert a C Structure to C++ class

Hi all,

I am about to convert a C structure to C++ class.

Example:

C code:

struct sTag
{
int siVar1;
struct sTag *next;
};

struct sTag *pfnGetInfo()
{
...
}


I start converting the above C code to C++ code as below..

class clsTagInfo
{
public:

int siVar1;
struct sTag *next;

struct sTag *pfnGetInfo();
};

Here the problem occurs. I dont get how to convert the structure sTag *next as class object and how to further proceed with function returning the type struct.

Please clarify.

Thanks,
Rudk..
just replace 'struct sTag' with 'clsTagInfo'
Just look up the syntax of classes; it's not that different from structs so you shouldn;t have any trouble.
Ya. Its working fine. Thank you for your clarification (Bazzy and Zhuge).. :)
Topic archived. No new replies allowed.