[quote="DarTH"]
node *newNode()
{
node *temp=(node *)malloc(sizeof(node));
...
return temp;
}
node *sth;
sth=newNode();
[/quote]How does this make anything more efficient? If the "..." part is long and appears identically in many places then maybe, but not otherwise.
Unless there's lots of standard initialization code for a node I'd write that simply
node *sth = malloc(sizeof(node));
Also your function could be improved. The parameter list should be (void), not () which makes it an old-style declaration. The (node *) cast for malloc is redundant and IMO bad style in C (if you're writing C++ then it's necessary boilerplate).