Why we need to cast the buf since it's already a char? wouldn't work the same wi...

Panagiotis Giannou Answered 1 answer
Question by Panagiotis Giannou 6 months ago

Question

Why we need to cast the buf since it's already a char? wouldn't work the same without the (const char*)?

Answers

Answered by Daniel McCarthy

Instructor

The point of the lecture is to show that const keywords prevent writes at the compiler level. We also have to cast to const to make that happen as char* is different from const char* as a char* is writeable so long as theres no const.