binary digit matrix implementation by using 2D vector

How I can implement the following matrix by using just 2D vector (not matrix,...) in C++?

1
2
3
0 0 0 1 1 1 1
0 1 1 0 0 1 1
1 0 1 0 1 0 1


Above matrix is just an example and its 3 digit binary numbers except column contain 0 0 0.

I need a code which I can extend a number of rows to 4 digits, 5, 6,... for other classes(in each class the number of rows will change)and I need a piece of code which I can use in all classes, commonly.
Last edited on
lastchance did post code in your earlier thread http://www.cplusplus.com/forum/general/233262/
that works with any number of rows and columns.
@keskiverto
yes, lastchance did post a code and it works well alone, but I'm looking for another method/ way to reach my goal because this code is not working when I want to replace in a project contains classes (base and derived classes),
also on the post where lastchance answered, I told clearly that I need a code contain just 2D vector, and his/her code was built with matrix function.
Now, I post again here, maybe another person can help me.
Last edited on
What "matrix function"?

That code had
using matrix = vector< vector<int> >;
You do know what that means?

Or put other way, what is a "2D vector"?


Yes, you do mention "base and derived classes", but you don't show anything about them. Then you make a blatant claim "code does not work", but based on the information you have given it is more likely that your attempt to integrate code, that you did receive on request that did not include "classes", with your classes had a flaw.

You have not shown what you have attempted and therefore we cannot point out what you should have done differently.


Now, lets suppose that "another person" pops in. Totally oblivious about what lastchance did offer in previous thread. Misunderstands your question, like I apparently did, and offers solution that is essentially identical to lastchance's. Is that desirable? Is that avoidable?
@keskiverto
I explained there about the classes and errors, and please don't mix this topic with last one.
I created a new topic because that code was not proper for me, and now I'm looking for a new one and I didn't violate the rule of the forum, and I cannot understand why you talk aggressively??
Pehaps this isn't my business, but that wasn't aggressive. Try reading it again.

In any event you haven't provided enough information; I can't yet help you either.
The questions @keskiverto posed weren't rhetorical. Consider them appropriately, and please don't report posts unless they objectively violate the rules.

Topic archived. No new replies allowed.