I'm curious as to how you managed to create a functional linked list all by yourself, and yet make such a mess over something as trivial as setting a flag and testing it.
A flag is simply a...
Type: Posts; User: Salem
I'm curious as to how you managed to create a functional linked list all by yourself, and yet make such a mess over something as trivial as setting a flag and testing it.
A flag is simply a...
This is what you had originally.
void display ( node *p ) {
while ( p != NULL ) {
printf("%d->", p->data);
p = p->next;
}
}
You had a working display() function in your original post.
All you needed to add to it was a test to record whether (or not) you've seen an out of range value.
When you're done printing, you...
> #include <Stdio.h>
It is usual to write filenames in lowercase, even when your local file system seems to ignore case.
> #include <malloc.h>
malloc is in stdlib.h, which you already include...