News for hackers. Stuff that matters.
Re:Massacring C Pointers (2018) by reader_1000 on Saturday September 05, 2020 @10:30AM (#24383791)
I actually meant that pointer type is also important to understand the concept. I may not have stated it well. Yes, it does not store the type of the variable it points to but type of the pointer matters and it is significant because many operations depends on it.
Re:Massacring C Pointers (2018) by cassepipe on Saturday September 05, 2020 @12:02PM (#24384544)
C beginner here. I think you stated it well : "and a type" The post you responded to on the contrary misses your point that in memory a pointer is a variable that stores both an address and type information to what it points to.
Re:Massacring C Pointers (2018) by js2 on Saturday September 05, 2020 @03:10PM (#24386090)
No, it does not. The compiler knows the pointer type so that it can generate correct assembly, but the pointer type is not something stored in memory past the compilation phase.