You have to represent it as a struct, and provide a set of functions to do what the members do. You have the added complication of having a string object in that struct. It's easiest to declare a fixed length buffer for that. But you have to use C string operations on it.
So you end up with:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#define DATA_SIZE 64
struct node{ // EDIT: changed class to struct
char data[64];
node* next;
};
// constructor
void init(node* obj, constchar* a)
{
strncpy(obj->data, a, DATA_SIZE);
obj->next = NULL;
}
void setnext(node* obj, node* a)
{
obj->next = a;
}
... and so on. Clearly no one is going to do the whole thing for you. You'll have to finish it from here.