Function question

closed account (LN3RX9L8)
Is void a return type or what type of function is it?

Can someone explain the differences between int and void functions?

void is a return type - meaning no value is returned from the function.

Functions can return any kind of built in type plus any user type such as a class object.

The type of the function is the type of data it returns. Declaring it as

int function_name()

is like having

int return(1)

for a return statement (but don't do that).
Topic archived. No new replies allowed.