Guys i am stuck with this homework problem for C++, how do i print this 2d vector array by only using the loops once?

guys i am stuck with this homework problem for C++, how do i print this 2d vector array by only using the loops once?
#include
#include
using namespace std;

int main () {
int arr[4][3]={{5,2,3},{7,1,4},{3,4,7},{8,1,2}};
vector< vector > vec(4, vector(3));
for(int i=0;i

Other urls found in this thread:

Sup
twitter.com/NSFWRedditVideo

>I am stuck
>what I really mean is I want you to do it for me
>what are code tags?
kill yourself

that being said I'll do it for you if you paypal me $5

Chill u prick

I'll do it for $4.

the problem is always the second array somehow not declared in this scope.
so i don't know how to solve it

>expecting others to read badly formatted code with no indents and do your homework
>"""chill u prick"""
you're the prick

the comment was directed towards me (OP)

If you can't solve this on your own, then it's time to learn how to flip burgers.

This code can only run on a Gentoo based system. Install gentoo, then check back.

Wait, you want to get rid of one of the for loops?
Also, for clarity:

[Code]
#include
#include
using namespace std;

int main ()
{

int arr[4][3]={{5,2,3},{7,1,4},{3,4,7},{8,1,2}};
vector< vector > vec(4, vector(3));

for(int i=0; i

did you even read the rules?
Sup Forums.org/rules#g

use codetags you fucking cuck

LEL lets try that again
#include
#include
using namespace std;

int main ()
{

int arr[4][3]={{5,2,3},{7,1,4},{3,4,7},{8,1,2}};
vector< vector > vec(4, vector(3));

for(int i=0; i

>use codetags you fucking cuck
chill your fucking panties mate. used the wrong slash at the end.

lol, yeah i had to repeat the 2d arrray loops just to print them out. i don't want to

lel kys faggot
auto arr = [[5,2,3],[7,1,4],[3,4,7],[8,1,2]];

arr.join.writeln;

why not just do this:
for(int i=0; i

this is wrong
correct code should be:
for (auto elnt : vec)
std::cout

i mean you need two loops but you get what i mean

>you get what i mean
OP here

I really don't know what you mean

It took me 3 weeks to wrap my head around nested for loops

wow this works. yeah thanks man.
i don't know why that extra {} makes the difference though.

no this is me, but you aren't wrong :(

thanks for the help