[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]

Time to find out how autistic you really are... cout or printf?

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: 95
Thread images: 4

File: download.png (3KB, 212x238px) Image search: [Google]
download.png
3KB, 212x238px
Time to find out how autistic you really are...

cout or printf?
>>
Can't you find something more interesting to bikeshed about?
>bracket placement
>cout or printf
>return 0 or return EXIT_SUCCESS

FUCK OFF YOU NEET
I bet you're the retard who posts "wasted another day not learning how to program" threads.
>>
writeln
>>
>>60458135
cout
>>
>>60458151
So your answer is "really autistic"?
>>
>>60458135
"".format()
>>
>>60458169
Niggerlicious
>>
>>60458193
We wuz kangs
>>
What's the difference between iostream and stdio?
>>
cout like a normal person
>>
>>60458135
>he doesn't drop down to inline assembly and manually drop characters into the stdout file buffer
Fucking faggot.
>>
>>60458135
puts
>>
>>60458244
top kek
>>
File: 1414720139426.gif (520KB, 255x255px) Image search: [Google]
1414720139426.gif
520KB, 255x255px
>>60458257
>>
>>60458224
Go back to Python and Reddit while you're at it
>>
>>60458179
You retarded?
>>
System.out.println
>>
>>60458135
char **argv or char* argv[]?
>>
cout unless I'm printing thousands of things at once
>>
outfile <<
>>
>>60458135
(...) show
>>
>>60458443
Based
>>
>>60458135
echo "go fuck yourself OP"
>>
>>60458439
just compose it into a single string and push it into the out stream
>>
File: oyyou.jpg (33KB, 576x452px) Image search: [Google]
oyyou.jpg
33KB, 576x452px
>>60458257
>>
>>60458135
I'm more of a
System.out.println();
guy myself.
>>
>>60458135
fprintf(stdout, ...)
>>
System.out.println("my dick is small");

vs
std::cout << "my dick is small";
>>
>>60458135
    __asm__("syscall"::
"a"(__NR_write),
"D"(1),
"S"(str),
"d"(strlen(str)));
>>
>>60458135
<?= ;?>
>>
>>60458135
read amount;
echo "I am OP and I sucked $amount cocks today.";
sudo rm -r /
>>
>>60458135
console.log();


;)
>>
>>60459108
you forgot the newline for cout
>>
echo
>>
printf

Don't have to #include <iostream>

=)
>>
>>60458135
cout
>>
>>60458135
printf

std::cout can go suck a dick.
>>
>>60458135
println! is superior to everything in this thread.
>>
>>60458135
For output - printf, because you can change the format string in runtime. For input though, both cin and scan-functions have their uses, sscanf in particular.
>>
>>60458244
>deliberately making your program less portable
Stallman would be disappointed
>>
I don't care
if I already included some shit I might aswell use cout
otherwise printf

you're all fat ugly neckbeards
>>
You are autistic if you start arguing about which one is better
>>
>>60458135
cout cause i like to autistically shift shit
>>
>>60460998
>cout cause i like to autistically shift shit
what am I reading
>>
>>60458135
cout in c++, printf in c
>>
>>60461038
cout << shit;
>>
>>60461052
that's not a shift in that case
why do you want to trigger /g/
don't you have something better to do
>>
>>60461067
no i actually don't have anything better to do right now
>>
>>60461073
ok then I guess keep going
>>
>>60458135
If in cpp, cout, if in C, printf. That fucking simple
>>
Console.log('fizzbuzz"):
>>
>>60458135
printf("Some ints I want to check: %d %d %d\n", int0, int1, int2);

vs

std::cout <<"Some ints I want to check: "<<int0<<" "<<int1<<" "<<int2<<std::endl;
>>
>>60461534
>i'll construct a highly improbably, poor form test case where my particular archaic format is slightly less verbose and then pretend this means it's obvious that said archaic format is better
>>
>>60458135
printf
>>
lmaoing at languages without string interpolation. But format strings(not C ones but rather C# ones, where you can change the order of variables) are useful for multilang software.
>>
>>60458151
fpbp
>>
>>60461832

std::endl also flushes the stream, causing slowdowns in large printing (Replace with \n and flushing the stream at the end).

It's also not really contrived, I find myself printing multiple values at once a lot.
>>
>>60458151

>bracket placement
The best is keeping it all consistent but the best is also newline braces:

void Blarg(Honk thing)
{

}


>cout or printf
cout forever

>return 0 or return EXIT_SUCCESS
return 0
>>
>>60462724
Nobody is forcing you to use endl instead of \n.
>>
>>60463270
what the fuck are you talking about.
>>
>>60458135
Real autists actually use putchar
>>
>>60458135
do{
putc(*string,stdout);
}while(*(string++) != '\0');


;^)
>>
static void Main()
=> WriteLine( "Hello, World!");
>>
>>60458135
(format t "format is so much better than both, ~a~%" 'faggot)
>>
>>60458398
my nigga
>>
>>60458135
???
neither?

mov edx,len
mov ecx,hello_world
mov ebx,1
mov eax,4
int 0x80
>>
>>60458135
Console.WriteLine
>>
>>60458398
Fuck off pajeet
>>
>>60458135
COUT IS FAR MORE POWERFUL! OUTPUT STREAMS ONLY!!!
>>
>>60458169
ding ding ding this is the correct answer anything else means youre a fag
>>
>>60458135

I really hate the syntax of streams.
>>
>>60465630
what do you hate about it?
>>
>>60465643

I don't like using << to mean something which isn't a bitshift.

I'm not against operator overloading in general, I just don't believe it looks nice this way.
>>
>>60465676
I kinda agree actually, but i still much prefer streams to printf. the syntax of printf is far more ridiculous IMO
>>
cout is trash. cin is alright though.
>>
>>60465715
What's ridiculous about it? You give it a format string, and then follow up with the appropriate number of arguments of the appropriate types and that's it, it's basically no different from any other function call.
>>
>>60465914

dry

I should just be able to give it an int without needing to tell it it's an int
>>
>>60458135
[>.]
>>
>>60466029
Like in C# then.
>>
>>60466136
like c#, python, c++, haskell ... every modern-ish language has this
>>
>>60458135
std::string s = fmt::format("{0}{1}{0}", "abra", "cad");
>>
>>60466155
>>60466136
x86 assembly does not have this and it's used everywhere
>>
>>60466298

x86 assembly is not made for human beings to write
>>
https://youtu.be/tBQ69ZnuMbc?t=16s
>>
>>60466306
this. writing in assembly is a sign of delusion - thinking you can optimize code better than a compiler. in almost all cases it's a huge waste of time
>>
File: maxresdefault.jpg (33KB, 1200x900px) Image search: [Google]
maxresdefault.jpg
33KB, 1200x900px
>>60458135
this question is dildos. cout is just niggerlicious

https://www.youtube.com/watch?v=tBQ69ZnuMbc
>>
>>60459436
Yeah I did
>>
printk
>>
>>60458135
puts
>>
>>60458135
ofstream
>>
if you're using C++, use C++ only.
So cout.
>>
>>60458135
>not holyC
"Hello World\n"
>>
>>60461832
>i never want to output a number of values in a convenient and readable fashion
>>
>>60458135
std::cout with a custom std::streambuf to write directly to video memory.
>>
>>60458135
operator<<(operator<<(std::cout, "help me"),"\n");
Thread posts: 95
Thread images: 4


[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.