a have a struct like this :
struct nodo_text
{
int entero1;
char* texto;
nodo_text* SIGUIENTE;
};
i have a simple text file, which i read with fgets to get the text, like this :
nodo_text* nodo_aux;
char line[255];
while (fgets(line, MAX_TEXT, hSource) != NULL)
up to here everything is ok. But because i want to implement a simple linked list, i do this too :
nodo_aux = new nodo_text;
nodo_aux->texto = line; /* HERE IS THE PROBLEM */
if i leave it like that, the last line that comes from the file i am reading stays in all the nodes of the list. I jsut want to copy from line to my text member node list!!!!
a cannot find a way to copy from line (an array) to
nodo_aux->texto. if i use strcpy like this :
strcpy(nodo_aux->texto, line);
i get an access violation error.
If i declare line to be :
char* line;
i get an assertion failed.
does anybody can help me???
thanks a lot in advance,
__Dgc