Answer the question
In order to leave comments, you need to log in
How to add a new character to a character array?
I would never have thought that I would ask such... "obvious" questions. But be that as it may, I really got stuck when I tried to put an element into the array:
char mass[100];
mass[0] = "e";
To which Visual Studio told me
error C2440: '=' : cannot convert from 'const char [2]' to 'char'
1> There is no context in which this conversion is possible
So what should I do???
PS Sorry for all the stupidity of the question.
Answer the question
In order to leave comments, you need to log in
Change quotes from double to single. "e" is an array of two elements: character "e" and terminating null. Whereas 'e' (in single quotes) is a character.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question