Can anyone tell me why the following ligitimate code does not work, creating a linked list of characters from stdin?
struct Nodec {
char element;
Nodec *edge;
};
void Nodecin(Nodec *N) {
char c;
Nodec *tmp;
if (N == NULL) {N = new Nodec;}
tmp = N;
do {
c = fgetc (stdin);
tmp->element = c;
tmp->edge = new Nodec;
tmp = tmp->edge;
} while (c != '\n');
}