
February 19th, 2015, 11:51 AM
|
 |
Command Line Warrior
|
|
Join Date: Sep 2005
Posts: 1,021

Time spent in forums: 2 Weeks 8 h 12 m 36 sec
Reputation Power: 14
|
|
This is a bit weird:
bnode *cur=(bnode*)malloc(sizeof(bnode));
cur=NULL;
You're allocating memory and then never using it.
Besides that, as far as I can see, you're creating newn, then setting cur to point to it, then freeing it, then setting cur to top, which is still pointing at NULL. Which is bad.
__________________
There is no such thing as C/C++, you either program C or C++
|