News for hackers. Stuff that matters.
Re:Massacring C Pointers (2018) by saagarjha on Saturday September 05, 2020 @12:49PM (#24384945)
They’re not variables until they’ve been specified a type, which is at the point you first assign to the memory in a typed fashion I believe. It’s significantly more pedantic than the first line in an introductory text will go into, though ;)
Re:Massacring C Pointers (2018) by grayhatter on Saturday September 05, 2020 @06:36PM (#24387401)
Nah, that's wrong. A variable doesn't need a type. Case in point; void.
Re:Massacring C Pointers (2018) by icedchai on Saturday September 05, 2020 @07:32PM (#24387694)
All 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.
Re:Massacring C Pointers (2018) by eru on Sunday September 06, 2020 @05:41AM (#24390179)
So 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.

Re:Massacring C Pointers (2018) by saagarjha on Saturday September 05, 2020 @07:24PM (#24387647)
I'm not sure what you mean, could you explain a bit more?
Re:Massacring C Pointers (2018) by eru on Sunday September 06, 2020 @05:39AM (#24390170)
Are you saying void is not a type?