(Syntax) Chapter 05 - Page 30 - Vertex Shader source

Author: michaelhiattCreated Jun 5, 2025Updated Jun 5, 2025

Regarding the syntax of the C style string for vertexShaderSource, there may be a good reason to do this and there is more experienced C programmers than me, however I'm not certain the \0 is required at the end of the string given the way it has been constructed.

My understanding is that when make a C style string (const char *aString = "the string contents") the compiler will automatically add a \0 (null terminator) to the end of the string.

When constructing a character array, the array would need to explicitly have the \0 inserted at the end of the intended string.