Hello I am having trouble declaring a variable "answerArray" in my structure for my code. This is the code I have written:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
struct Scantron {
char Name[21];
char Id[11];
char CRN[6];
char testCode[3];
char specialCode[4];
char score[4];
char answerArray[62] = " ";
};
struct csvRecord {
char Name[21];
char Id[11];
char score[4];
char answerArray[124] = " ";
};
| |
When I run it through a clang++ compiler it generates this error and I'm not sure how to fix it:
fileTransform2.cpp:34:26: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
char answerArray[62] = " ";
^
fileTransform2.cpp:42:27: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
char answerArray[124] = " ";
^
2 warnings generated.
/tmp/fileTransform2-8559f3.o: In function `main':
fileTransform2.cpp:(.text+0x1c3): undefined reference to `readData(std::basic_ifstream<char, std::char_traits<char> >&, Scantron&)'
fileTransform2.cpp:(.text+0x2e4): undefined reference to `writeData(std::basic_ofstream<char, std::char_traits<char> >&, csvRecord)'
fileTransform2.cpp:(.text+0x30a): undefined reference to `readData(std::basic_ifstream<char, std::char_traits<char> >&, Scantron&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)