Question
Why we need to cast the buf since it's already a char? wouldn't work the same without the (const char*)?
Why we need to cast the buf since it's already a char? wouldn't work the same without the (const char*)?
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.