Hai everybody!I'm trying to implement a program to implement Quine McCluskey algoritm.While trying to compile with the following code,I got an error which says " no match for 'operator[]' in '((Table*)this)->Table::isMarked[r]' " .

Attached are the files: Table.h,Table.cpp,Term.h,Term.cpp

Please help!!!

Recommended Answers

All 7 Replies

I don't see that expression used in the files you've attached.

Shouldn't it be ((Table*)this)->Table::isMarked[r][c] ?

In the file Term.cpp line numbers 24 and 25 I have used 'isMarked[r][c]' and the error is occuring in these lines.

My problem is solved! Infact,I am using Dev cpp IDE.The compiler didn't recognise the 'c = 0 and 'r = 0' int the 'for' loops.If you notice,the same statement 'isMarked[r][c]' is not creating problem in any other part of the code.Anyway tons of thanks for your suggestion!!!It gave me the clue!

Glad you found the problem.

Still, I don't see the isMarked[r][c] in the term.cpp file you provided. You sure we're all looking at the same thing?

Sorry it is in Table.cpp

OK, with you now. Odd that the initialization in the for statement caused a problem, it should work. And it doesn't seem to jibe with the error message you report.

How'd you fix it?

Instead of doing the initialisation 'r = 0' in the 'for' loop I gave it seperately.I think problem was with the compiler that comes bundled with Dev-C++ (MingW32).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.