Am I declaring the iterators of the derived class r_iter and c_iter properly ? Inside the derived class, r_iter is a iterator of a 2D vector and c_iter is iterator into the 2 D vector.
I'm getting the following error and I'd really appreciate if somebody tells me where I'm wrong
add_round_key.cpp:26:34: error: expected class-name before ‘{’ token
add_round_key.cpp:27:2: error: ‘dVector’ is not a template
add_round_key.cpp:27:11: error: ‘dVector’ is not a template
add_round_key.cpp:27:28: error: invalid use of ‘::’
add_round_key.cpp: In member function ‘void dVector::RotWord()’:
add_round_key.cpp:37:2: error: ‘r_iter’ was not declared in this scope
add_round_key.cpp:37:17: error: ‘class dVector’ has no member named ‘begin’
add_round_key.cpp:38:2: error: ‘c_iter’ was not declared in this scope
line# 26 class dVector:public std::vector {
line# 27 dVector <dVector <int> >::iterator r_iter;
dVector <int>::iterator c_iter;
public:
void RotWord();
void SubWord();
};
void dVector::RotWord() {
int temp ;
line# 37 r_iter = this->begin();
#38 c_iter = (*r_iter).end();
*(c_iter) = *(c_iter+4);
*(c_iter+4) = *(c_iter+8);
}
void dVector::SubWord(){
//function definition
}
int main (int argc, char *argv[])
{
/*wordArray is a 4x4 word array stored in column-order form*/
dVector <dVector <int> > wordArray(4,dVector<int>(40,0));
dVector <dVector <int> >::iterator ckIter,i ,j, row_iter;
dVector <int>::iterator ii,jj, col_iter;
wordArray.RotWord();
wordArray.Subword();
}