Is there a problem with this?
char* field = new char[2]; field[0] = 'S'; field[1] = '\0'; char c = *field;
will always be equal to 's'?
No problem with that, c will always be "S".
This is perfectly normal - and c will always be equal to "S". Highlighting fielda type pointer charwill result in char.
field
char
The problem is that new char[2]C is not syntax. However, the general idea is correct: cthere will always be an "S".
new char[2]
c
There is nothing wrong. When you look for a field array in a string
char c = *field;
what you are actually requesting is the value of the first element of the array, in this case "S".