Now, this should create two files, one wrote normaly and the other in binary mode. The question is, why is second one so much bigger? sizeof(int)* 200 seems like the reason, but I bet I can write config.bin smaller (it's 800 bytes of size, config.txt is 200)
Ok, so I wrote same thing two times, just the second one is a complete waste of space, 4 times bigger...
question changes: How could I write this in binary code, for faster loading?
The answer to your question is simple: Your so-called "binary file" is four times bigger than the first one because you write four times the characters than you do in the first file since sizeof(int) appears to be 4 on your machine/system.
The question I unfortunately couldn't answer myself (and I'm very excited to hear the answer to), is: What the heck is this code supposed to do?
No, ios::binary (and usually it's ios::binary, not ios_base::binary) is required on system that draw a distinction between text and binary files, e.g. Windows. But tell me, what is so _binary_ about your second file? Just because you changed the file extension doesn't mean, the mime type changed.
I Know. What I dont know is how could I save files, so they could load faster...this is all I wanted to do from the start, but I didnt know much about ios::binary so it was all wierd and totaly not what I've wanted.