why do we use void if it returns nothing
void is a type to represent nothing. That is a subtle difference : the representation is still required, even though it represents nothing. This type is used as function's return type which returns nothing. This is also used to represent generic data, when it is used as void* .