Reputation: 157
I'm new to c/c++ and I've been working with python for a long time, I didn't take any tutorials, but I got this error when I tried to declare an array of strings.
code:
QString months[12]={'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'};
error: invalid conversion from 'int' to 'const char*'
What does that error mean?
Upvotes: 0
Views: 1898
Reputation: 574
In the Python is not difference between '
and "
(are strings) , but in the C++ They are different:
char c = 'c';
string str = "string";
Don't forget the C++ has not '''
, while it was as string in Python.
Your code:
... "Oct", "Nov", "Dec"};
Upvotes: 1