/* this is the lines structure then */
struct lines
{
vector<line>* lines_vector ;
int a ;
// the constructor will create get a char* and torkernize it into the
// lines and make line objects and push them into the vector.
char * getline (int line )
{
// this will output line number 'line'
line requested_line = lines_vector.at(line); // the error is here
return requested_line.str1 ;
}
int get_num_lines ()
{
return (int )lines_vector.size();
}
lines ( char * str , int length )
{
lines_vector = new vector<line>;
int current_position = 0 ;
int current_line_position = 0 ;
while ( current_position <= length )
{
char current_line [200] ; // we are assuming that the current line is not
// greater than the 200 characters... however this is NUTS
// the we are just copy them to our buffer
current_line [ current_line_position ] = str [current_position] ;
// if we found a '\n' then we should create and push the current line
// and also reset the current_line_position to zero
if ( str [ current_position ] == '\n')
{
// then create a new object of line
line * new_line = new line ( current_line , current_position );
lines_vector->push_back ( *new_line ) ;
}
current_line_position++ ;
current_position++ ;
}
}
};
The error is
"expected ';' before 'requested_line"
Anyway I really wondering what is the syntax error That I have did.