Chances this C++ code wil go wrong?

Just a sample of something "CLOSE" to what I did another day: Instead it outputed to a .txt file.


void Output() {
std::cout

seems like alot of code for just outputting variables to a file

Look up "american fuzzy lop"

It's been years since I've touched c++, but first, use endl, instead of "\n", and second, those variables a b c and d aren't defined so I think it will definitely go wrong.

Look around for the gentooman library (torrent). I think it had some c++ texts.

>use endl
just, no

That's not done anymore?

Why is C++ so ugly to look at compared to C?

Because it's a fucking awful language. Tired of this board and its shit opinions.

Look at this shit. Look at how people are taught to program.
>Recursive functions
>Overloading
>Templating
>Multiple calls of a function in another function

Just print the things. Simple.

First off, I think it's silly to create functions and such just to insert a space between values, just use a decent text editor. Second, it's probably not the greatest idea to use a recursive function even if it is probably being entirely optimized out or simply inlined at compile time. I would recommend that you instead create a wrapper class around your stream that adds the functionality you need.

#include

struct end_ {} end;

class SpaceAdder
{
public:
void operator

Is this a fucking troll post?

What are you trying to do anyway OP?

No its not a fucking troll post. Are you retarded? Any competent programmer should be able to see exactly what OP is trying to do. And while what he is doing is kinda dumb to begin with, if he's gonna do it, it should be done sensible way (i.e. anything but recursion).

Didn't say this in my last post but desu OP, good job for coming up with that solution. It's a pretty elegant use of recursion, it's just something that I personally wish to not see in code that I have to work with, and I hope that my previous answer can give guidance of some sort.

You're totally right that OP should just print things out, but since you insist that c++ is total shit, please enlighten me as to how you would achieve what OP is actually trying to do in any language other than lisp.
>pro tip: you can't

>class SpaceAdder
>Operator overloading

The fucking irony of this post.
Just add the space. I'm surprised you didn't inherit from another class too.

It's like you don't even know what you are railing against.

What are you trying to do in your code?

Why are recursion and templating bad?

endl flushes the stream while \n is just for a new line. End result is the same however flushing the stream every time you need a new line is fucking retarded. I just use it last.

All you want in programming, 97% of the time, is the dumbest thing you can do, right?
Because the simplest thing is easy to read, it's quick, and it's easy to fix and optimize later on.

Just know what you're going to do, don't build for every single scenario.
Templates put people in the mindset of exactly that.
>Oh, maybe I need to make sure the function can take every single type just in case

wew
lad

ITT: People who clearly have never been paid to write a single line of C++ in their life.

Python 3:
print(*args)

It's sensible to expect a print function to take as argument anything that can be written to stream.

Thank fucking god. Otherwise we'd have to deal with things like this

Get some insight on the intent first.
You can't code shit if you don't know what contract the function you're writing is supposed to provide.

Output (...) here will output all arguments on stdout, separated by a space and ending with newline (provided each argument has a stream

Op here, what I was trying to achieve was a simple way to output an infinite number of parameters.

Write a fucking function. That's all you need.

Fag who doesn't know what templates are.