int main()
{
int i;
nodeptr *k;
nodeptr j;
nodeptr o;
nodeptr head;
nodeptr prev;
nodeptr h;
int a;
int u;
int v;
int w;
int *px;
int r;
nodeptr end;
nodeptr s;
nodeptr temp;
nodeptr start;
p=getnode();
Sorry, I'm not going to try to read that unformatted, un [code]code-blocked[/code] stuff... [edit] Not right now, that is... I'm tired...
Best way to start is to get out a piece of paper and a crayon (or a pen, if you want to be all intellectual about it ;-) and draw yourself a linked list.
Then draw what you have to do to reverse it. You can do it in a single pass -- starting at the first node and working your way to the end, building the new list as you go.