Hi everyone, i kind of having trouble here with character copy. I currently building an linked list where stored character by character not word by word, i don't quite understand how to implement it. i means the error of the "assignment makes a pointer from integer without a cast". Can anyone give me a tips or idea how to deal with this problem cos i am not very good at c..Thanks.
Here is my sample code that doesn't compile..sorry for incovenient.
Code:typedef struct stringStruct { char character; struct stringStruct *next; }String; typedef struct head { struct stringStruct *head; }Head; /* This function copy the line from main.c character by character into the linked list */ void InsertCharacter(Head *head, char *_char) { String *current; /* some function */ /* I try to copy a character by character into the list */ while ((_char = getchar()) != '\0') { /* some function here */ current -> character = _char; /* error : assignment makes pointer from integer without a cast */ } } main() { Head head; char _char[30] = "This is a string"; InsertCharacter(head, _char); /* Here got an error too */ }



LinkBack URL
About LinkBacks


