-3

What is the value that is stored in void()? Basically it is used before a function which doesnot return anything. But does simply void holds any value?

2 Answers2

1

Void is an incomplete type which, by definition, can't be an lvalue. That means it can't get assigned a value.

So it also can't hold any value.

Pang
  • 9,073
  • 146
  • 84
  • 117
dhein
  • 6,133
  • 4
  • 40
  • 72
1

The use of void for a return value means simply that there is nothing returned. So, there is no value, because there is just nothing at all.

David Heffernan
  • 587,191
  • 41
  • 1,025
  • 1,442