[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

C++ help

  1. Home
  2. Board: /adv/ - Advice
  3. Reading: C++ help

Thread replies: 8
Thread images: 4

File: a.png (6KB, 561x213px) Image search: [Google] [Yandex] [Bing]
a.png
6KB, 561x213px
Hey guys so C++ anon is back.
Sorry to bug again but I'm stuck, I need to order and array in a 10x10 order as I print it out but I' having trouble with it
pic related is what I tried
>>
I have no idea what you are actually trying to accomplish here. Do you mean you just need to print 10 lines of 10 values for a total of 100 values?
>>
File: aa.png (33KB, 1331x501px) Image search: [Google] [Yandex] [Bing]
aa.png
33KB, 1331x501px
Kind of, I'm supposed to take an user input value between 100 and 2 and then after doing some other stuff print the results as a matrix of 10 columns
pic related is the main function
>>
File: aaa.png (14KB, 561x242px) Image search: [Google] [Yandex] [Bing]
aaa.png
14KB, 561x242px
second part of the code random number generator use to fill the array
>>
>>17328499
fuck wrong description, this is to get a valid user input
>>
I just have to say, I don't know if English is your first language or not, because your grammar is awful and is making it very difficult for me to know exactly what you want to accomplish. Regardless, what you need to do, assuming I understand you correctly, is just add:

if(n != 0 && n % 10 == 0){cout << endl;}

to the beginning of the loop. It'll check to see if 10 values have been printed, and if they have, it'll automatically move to the next line before printing the next value.
>>
File: 1443388174688.png (59KB, 350x326px) Image search: [Google] [Yandex] [Bing]
1443388174688.png
59KB, 350x326px
>>17328513
Anon I love you very much, a thousand thank you. You're the best anon on this site
and sorry for the grammar.
>>
>>17328448
/r/learnprogramming has an IRC chat, they're pretty helpful with questions like this
Thread replies: 8
Thread images: 4
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK