Its quite a common question but I have not got my answer so asking it again.
I have structers defined as:
struct f_lock{
int x;
struct f_lock *next;
};
Then say I have a function:
struct f_lock *new_node()
{
struct f_lock *new_f_lock;
.....
return new_f_lock;
}
Which I call from another function:
struct f_lock *new_f_lock;
new_f_lock = new_node(); //This line gives the error warning:assignment makes pointer from integer without a cast
Would be grateull for help Thanks
new_node()in scope. That being said, it's preferable you post code that people can use to reproduce your issue.function f_lock *new_node()notstruct f_lock *new_node()?functionis not reserved and has no special meaning. The original definition is correct. Without atypedef, the name of the type isstruct f_lock;f_lockby itself is not defined