This is a quick question, I did a search, but could not find anything that answered my question.
When executing a recursive function in C, do you need to have a return even when using the void function?
For instance:
void addToLL(structA_ptr new, structA_ptr cur) { if (cur->next == NULL) { cur->next = new; } else { addToLL(new, cur->next); } }
Do I need to put the return keyword before a function call? I know that if a function returns something, for example, it searches for something in LL, it will need a return statement.
source share