Home / Knowledge & Sciences / Mathematics, computer science & logic / Information technology / Why does type "void" have no memory size in C? Information technology Why does type "void" have no memory size in C? Bykabik334 December 3, 2023February 25, 2025 (1 rating, 1 votes, rated)You need to be a registered member to rate this.Loading...
void is simply a placeholder for "no nothing."
The data type void indicates to the compiler that no variables are used at this point.
In most compilers it doesn't matter whether you write da void or just nothing.
main (void)
is as good as it is
main ()
the void shows everyone who reads the program that you did not use any variables.
Because void English for void is not a data type but an expression that is nothing.
"void" means the absence of values of any kind.
If you don't have anything to store, you don't have to reserve a memory.
Void gives stop to which you don't want to save if you add string for example, it's a string but void is nothing