In problem 266A eclipse tell me this error : comparison with string literal results in unspecified behaviour [-Waddress] and tell me that the error is here if (q[i] == "B" && q[i+1] == "G") my code ~~~~~
include
include
using namespace std ;
int main(){
int n , time ;
cin >> n >> time ;
char q[n][10];
for (int i = 0 ; i<n ; i++){
cin >> q[i];
}
for (int l = 0 ; l<time ; l++){
for (int i = 0 ; i<n ; i++){ if (q[i] == "B" && q[i+1] == "G"){
swap(q[i],q[i+1]);
}
} }
for (int i = 0 ; i<n ; i++){
cout <<q[i];
}
}
~~~~~
a little googling got me this