Code Snippet :
#include<iostream>
using namespace std;
int main()
{
int num[] = {1,2,3,4,5,6};
num[1] == [1]num ? cout << "Success" : cout << "Error";
return 0;
}
Error :
expected primary-expression before '[' token.
Description :
In line 6, the syntax for representing an array is wrong,i.e '[1]num'. Instead,it should be like 'num[1]'.
#include<iostream>
using namespace std;
int main()
{
int num[] = {1,2,3,4,5,6};
num[1] == [1]num ? cout << "Success" : cout << "Error";
return 0;
}
Error :
expected primary-expression before '[' token.
Description :
In line 6, the syntax for representing an array is wrong,i.e '[1]num'. Instead,it should be like 'num[1]'.
No comments:
Post a Comment