(The same) segmentation error problem.
I have a structure
Code:
typedef struct node{
int rownum;
char content[MAXCOL];
struct node *next;
}nodez;
and i want to copy a (global) string named TBUFF into content ( located in the structure ).
Code:
strcpy(last->content,TBUFF);
Using the above line results in a segmentation error.
Please help me.
Thanks in advance.
Oh... didnt think about validity of last pointer.
If i assume that "Last" points to a valid location.
Will the above statement give me the base address of the content *string*. Will the above statement do what it is supposed to do.