If I have a struct defined as
struct node {
char *data;
struct node *next;
};
typedef struct node* nodePtr;
nodePtr newNode;
...
int main(void) {
newNode = (nodePtr *) malloc(sizeof (nodePtr)); //dynamically allocate memory
if(newNode == NULL) {
printf("Error: could not allocate a new node\n");
exit (1);
}
...
and read in a string with fgets that I want to assign to data of the current node, what does the line look like?