Can't initialize the variable a, why:
The following error & warning messages appear:
[highlight]Error E2291 test.cpp 11: } expected in function main()
Error E2034 test.cpp 11: Cannot convert 'char *' to 'T' in function main()
Error E2141 test.cpp 11: Declaration syntax error in function main()
Error E2139 test.cpp 11: Declaration missing ; in function main()
Warning W8004 test.cpp 11: 'a' is assigned a value that is never used in function main()
Error E2190 test.cpp 11: Unexpected }
Error E2190 test.cpp 12: Unexpected }[/highlight]
Code:
#include <iostream>
using namespace std;
typedef struct {
string a, b;
int c;
} T;
int main() {
[highlight]T a = {"a", "b", 5};[/highlight]
}
The following error & warning messages appear:
[highlight]Error E2291 test.cpp 11: } expected in function main()
Error E2034 test.cpp 11: Cannot convert 'char *' to 'T' in function main()
Error E2141 test.cpp 11: Declaration syntax error in function main()
Error E2139 test.cpp 11: Declaration missing ; in function main()
Warning W8004 test.cpp 11: 'a' is assigned a value that is never used in function main()
Error E2190 test.cpp 11: Unexpected }
Error E2190 test.cpp 12: Unexpected }[/highlight]