Today's g++/C++ funny: ofstream's open constructor

So, I’m working on a project, and have some code like this:

string blah="somefile"; ofstream fp;

fp.open(blah);

And it doesn’t work. Apparently, what you need to do when using ofstream’s open method:

fp.open(blah.c_str());

Yes, it looks like what it is. Apparently g++’s iostreams library (gcc 3.2) does not support things that have been part of the C++ standard for years–like C++ STL strings… You have to convert back to a C string.

Last I checked this was 2005, not 1999. You’d have thought someone would have overloaded this by now… I’ve only checked this in g++; will check with Intel’s C++ compiler and Microsoft Visual Studio later, though I’m not sure whether to expect better. What didn’t help me to find this out, of course, is g++’s totally wonderful (sarcasm) compiler error messages…

Creating a Slackware UML Root FS

A while back I had a Debian Woody server, and was attempting to run modern software on it… Hah! So, I looked into creating a User Mode Linux install of Slackware to run my newer apps on. It worked well, and I documented some of the stuff I did.

This is an older version of my site, content that I never transferred over to this new one.

Note: These instructions apply to Slackware 10.0 and have not yet been updated for 10.1 or anything later

Type: 

My take on Grand Theft Auto: San Andreas

I finished Grand Theft Auto: San Andreas for the PC this past week. Overall, I liked it–better than the previous games Grand Theft Auto: Vice City and Grand Theft Auto 3.

Rockstar really added some pointless crap, probably to appeal to a larger audience. I almost felt like I was playing The Sims (why is this game still on the top 10? I mean, really, they have to run out of idiots to buy it?) when I had to work-out CJ (your character), muscle-up CJ, feed CJ, go out on dates with CJ’s multiple girlfriends, and worst of all, DANCE DANCE CJ.

The game starts off sort of slow at first, with a lot of emphasis on story. Not a particularly wonderful story either, I didn’t really get into it, and almost stopped playing because of how boring it was getting (one of the missions is to drive your homies to the equivalent of the Taco Bell drive-thru).

The girlfriends suck (not in that way). Probably alluding to the fact that I don’t have a girlfriend myself (ehhh… after the last one), I took great glee in shooting all the girlfriends (who weren’t crucial to the story) in the head with my AK-47.

One of things that bothered me about the Vice City game in the series was how much smaller it was than Grand Theft Auto 3–San Andreas rectified this completely, the game world is HUGE, with the performance much better than GTA3. Part of the story, your character wakes up and asks “Where am I?” to which you’re given the response “In the middle of fucking nowhere.” And, you are! It took me 10 minutes of driving in-game (though, I later found out faster ways) to get back to the part of the map I was previously.

You can tell they didn’t give too much thought into the PC port with respect to game control. Controlling airplanes is next to impossible to do with the keyboard. Not until I took out my gamepad could I even get the airplane to stay level in the air. What I thought was the absolutely most difficult mission in the game (and all 3 of the 3D ones, and actually was pretty difficult in the original 2D Grand theft Auto) was the RC missions, particularly the RC plane. Luckily, apparently you don’t have to win this mission to complete the game. The camera movement when driving is not too great either (different than from previous games), but you get used it after a while.

So, yeah, I liked it. Best single-player game I’ve played in a long while. Too bad there is no multiplayer.

Topic: 

Pages

Subscribe to Samat Says RSS