[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
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /adv/ - Advice

Thread replies: 8
Thread images: 4
File: a.png (6 KB, 561x213) Image search: [Google]
a.png
6 KB, 561x213
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 (33 KB, 1331x501) Image search: [Google]
aa.png
33 KB, 1331x501
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 (14 KB, 561x242) Image search: [Google]
aaa.png
14 KB, 561x242
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 (59 KB, 350x326) Image search: [Google]
1443388174688.png
59 KB, 350x326
>>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

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.