+ 2
could anyone tell me what is the error for that piece of code..why it says that b and c are not declared??!
#include <iostream> using namespace std; int main() { char a[3]={a,b,c}; cout<<a[1]; return 0; }
4 Respostas
+ 2
@ Enzo thank you
+ 2
@aklex thank you
+ 1
Because you didn't declare b or c. The compiler is expecting them to be variables. I think what you are trying to is this:
char[3] = {'a', 'b', 'c'};
0
it thinks your talking about variables, put quotations marks around the letters.