-->

Jul 13, 2017 Difference between void main, int main and int main (void) in C and C? Skip navigation Sign in. Void main, int main and int main (void) in C and C interview question?? Technical God. However, main's exit value will then always be 0 and therefore useless to test for a certain execution completion status. Alexsandro Meireles wrote: Hi, all! I tried to use the following expression in Dev-C void main (void) The compiler give a warning message 'output of main is not int'.

When used as a function return type, the void keyword specifies that the function does not return a value. When used for a function's parameter list, void specifies that the function takes no parameters. When used in the declaration of a pointer, void specifies that the pointer is 'universal.'

If a pointer's type is void*, the pointer can point to any variable that is not declared with the const or volatile keyword. A void* pointer cannot be dereferenced unless it is cast to another type. A void* pointer can be converted into any other type of data pointer. Mac http manuals.info.apple.com en boot_camp_install-setup.pdf.

A void pointer can point to a function, but not to a class member in C++.

You cannot declare a variable of type void.

Example

Void

See also

Void Main Error In Dev C Full

Keywords
Built-in types