Originally Posted by
ampc
oh,thank you,now i turn it to gets/puts functions, but i want to use unicode version,still error when i run it!
[CODE]struct List
{
TCHAR *data; <--- need to assign size
struct List *next;
};
[CODE]
To make life easyier... When using structs like this you should assign a field size for your string.
You might also want to use void pointers since a pointer to a structure is undefined within the structure's own definition.
Code:
typedef struct tList
{ char data[100];
void* Next; }
List, *pList;
Then in your linking code you would use...
Code:
// list tracking
pList Head; // start of list
pList Current; // current item
// init new chain
Head = malloc(sizeof(List));
Current = Head;
// add to chain
Current->Next = malloc(sizeof(list));
/* insert data here */
// move to next item
Current = Current->Next;