[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Is there a shittier C++ book than "C++ Primer"?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 1

File: scren.png (32KB, 501x478px) Image search: [Google]
scren.png
32KB, 501x478px
Pic very related, the code doesn't even work. It's just an infinite loop because the loop doesn't terminate when the user enters a return.
>>
>>61342683
it's called ctrl+c genius
>>
have you tried pressing ctrl-d you fucking inbred

also take note of how much less readable that is than it's c counterpart

while ((c =getchar()) != EOF) {
sum += c - '0'
}
>>
>>61342739
Are you fucking terminally retarded? That terminates programs immediately, it would not output the sum.
>>
>>61342683
You're reading into an int. Input a letter and
while(std::cin >> value)
will evaluate to false, it therefore won't execute
sum += value
and then the execution will continue.
>>
>>61342768
>less readable
the only thing you´d have a point is ">>"
everything else is clear as day
and seriously
sum += c - '0'
is not and will never be more readable than
sum += value
>>
>>61342917
subtracting '0' makes the conversion explicit, and will save you from many errors.
otherwise you're just lying to yourself, and that is the definition of confusion.
considering there are basically two differences (and i just clarified the one you didn't give to me), there's not really much else to argue on, and the stream out certainly isn't readable.
>>
>>61343050
ok that´s reasonable
i came at it from a pure "if someone who doesn´t program at all can´t read it and tell what happens it´s not readable" perspective
sorry for that
i think i´m growing dumber from teaching c++
>>
put EOF

ctrl+d
>>
>>61342768
less reasable... unless you know C++

unless you know that iostreams can be converted to bools...
>>
>>61342768
hurr durr Japanese is so unreadable
>>
>>61342768
Retarded idiot.
>>
>>61342683
Some say C++ Prime Plus is the shittiest one.
Never had a problem with it though...
>>
>>61342683
>user enters a return

There is no user. The expected input is obviously a file from the description above the code
Thread posts: 14
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.