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
July 5, 2017 - 09:35
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
July 5, 2017 - 09:37
the problem is always the second array somehow not declared in this scope. so i don't know how to solve it
July 5, 2017 - 09:41
>expecting others to read badly formatted code with no indents and do your homework >"""chill u prick""" you're the prick
July 5, 2017 - 09:42
the comment was directed towards me (OP)
July 5, 2017 - 09:44
If you can't solve this on your own, then it's time to learn how to flip burgers.
July 5, 2017 - 09:44
This code can only run on a Gentoo based system. Install gentoo, then check back.
July 5, 2017 - 09:44
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
July 5, 2017 - 10:03
did you even read the rules?Sup Forums.org/rules#g
use codetags you fucking cuck
July 5, 2017 - 10:04
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
July 5, 2017 - 10:04
>use codetags you fucking cuck chill your fucking panties mate. used the wrong slash at the end.
July 5, 2017 - 10:05
lol, yeah i had to repeat the 2d arrray loops just to print them out. i don't want to
July 5, 2017 - 10:05
lel kys faggot auto arr = [[5,2,3],[7,1,4],[3,4,7],[8,1,2]];
arr.join.writeln;
July 5, 2017 - 10:06
why not just do this: for(int i=0; i
July 5, 2017 - 10:08
this is wrong correct code should be: for (auto elnt : vec) std::cout
July 5, 2017 - 10:08
i mean you need two loops but you get what i mean
July 5, 2017 - 10:09
>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
July 5, 2017 - 10:11
wow this works. yeah thanks man. i don't know why that extra {} makes the difference though.
July 5, 2017 - 10:12
no this is me, but you aren't wrong :(
thanks for the help
July 5, 2017 - 10:13