Hello,
the below is a segment of code from my program and is part of a switch statement case1:
cout <<"Enter the name of the pattern file you wish to load: " << endl;
cin >> patternfile;
filein.open(patternfile.c_str());
if(filein.good())
{
filein>>firstword;
while (firstword =="PATTERN")
{
filein>>patternarray[command];
}
}
i need the program to read in commands from a text file into an array so the array can be accessed to draw a pattern from.
when executing i get the following error:
C:\Documents and Settings\Peter Briers\My Documents\NEW COURSE\SW design and Imp\Labs\wk12\soft10071\cwork1\main5.cpp(60) : error C2677: binary '[' : no global operator defined which takes type 'class std::basic_string<char,struct std::char_traits<c
har>,class std::allocator<char> >' (or there is no acceptable conversion)
Error executing cl.exe.
which is to do with line 60 which is:
filein>>patternarray[command];
Thanks for your time
Peter