-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,564
  • 146
  • 81
  • 122
dhein
  • 6,431
  • 4
  • 42
  • 74
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
  • 601,492
  • 42
  • 1,072
  • 1,490