Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Commodore64
1 year ago

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.

Kelec
1 year ago

Because void English for void is not a data type but an expression that is nothing.

Trilobit
1 year ago

"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.

Nik8899
1 year ago
Reply to  Trilobit

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