4 ms·
Nah, that's wrong. A variable doesn't need a type. Case in point; void.
by grayhatter 6y ago
Nah, that's wrong. A variable doesn't need a type. Case in point; void.
- saagarjha 6y agoI'm not sure what you mean, could you explain a bit more?
- icedchai 6y agoAll variables have types in C. You can't declare a "void" variable. You can declare a void function. Try assigning it to a variable. You can't. void pointers (void*) are a different story.
- eru 6y agoSo just the opposite of what the comment you replied to suggested: 'void' is a type, but in C values of the type void are not first class. Ie a function can return a value of type void, but you can't assign it to a variable.
- eru 6y agoAre you saying void is not a type?