Original Fantasy => General Discussion => Topic started by: Entroper on August 22, 2008, 11:29:39 PM
Title: C++ is retarded sometimes.
Post by: Entroper on August 22, 2008, 11:29:39 PM
Apparently, using the stream operators produces results inconsistent with themselves. If I open an ifstream, and use the >> operator to read from the stream into a char variable, the program reads two bytes, and puts the second one into the variable. If, on the other hand, I open an ofstream, and use the << operator to output the contents of a char variable to a file, it outputs one byte.
:lame:
In other news, I've managed to decode the RLE-compressed maps. I need to finalize my own map format, and then I might actually be ready to do a map viewer.
Title: Re: C++ is retarded sometimes.
Post by: I.S.T. on August 23, 2008, 11:03:01 AM
Cool. :D
Title: Re: C++ is retarded sometimes.
Post by: Jorgur on August 23, 2008, 02:30:46 PM
I don't think the stream statements are native to C++...
Blame <iostream> :cycle:
Title: Re: C++ is retarded sometimes.
Post by: Entroper on August 24, 2008, 03:46:37 PM
<iostream> is part of the C++ standard library. I think the standard library, in comparison to Java and C#, is one of the biggest reasons for C++'s decline.
There are things you can do in C++ that you could never, ever do in Java or C#. But there are a lot of things you can do very easily in Java and C# that are a pain in C++, and could be made easier if the langauge were updated.