How to do something in C++ (besides traverse binary trees)

Posted on November 19th, 2007 by Chris.
Categories: Chris, General/Misc., Minesweeper, Programming.

Based on How to feel useful, here is a guide to the five steps for making a programming language actually feel useful, for C++ in particular:

1. Graphics - Make some windows! (google “windowing toolkit”)

Usually operating systems will offer some sort of programming library so you don’t have to reinvent the window. This varies from Windows to Mac to Linux. Additionally, there are windowing toolkits - downloadable libraries that let you make windows that work anywhere.
GTK, the GIMP toolkit, is best known for being used in many open source programs, like the GIMP (of course), GAIM, and DIA are built in. There is a tutorial, though it’s not entirely transparent.

Possibly preferable are Qt, a partially-open-source toolkit [tutorial], and wxWidgets [tutorial].

2. Web Browsing (google “C++ http library”)

One of the simpler ways of pulling web pages is through the use of http-fetcher, a portable library for making HTTP requests.

If you’re willing to stick to Windows-only (and .NET only in particular), this shows how. .NET has a fat library though, so if you’re using it you won’t need the rest of this.

3. File Manipulation

C++ has built in file handling (and more importantly, a good C++ tutorial will typically document this). Reading a file line by line is pretty straightforward [tutorial].

4. System calls

Use system() to make calls to other command line programs. [reference]

5. Redistributables

Fortunately, native compilability is C++’s h2 suit. In general, using a standard C++ compiler (the Microsoft compiler or G++, for instance), you get a binary file that can be run on any other computer (using the same operating system, of course).

—-

The Boost library is one of the most important C++ library collections, as well as one that will have a major impact on the next version of C++ (as Bjarne Sjourstrup, the creator of C++, said at a recent talk). It’s available at http://www.boost.org/. Most of it is lower level than what we’re talking about here, though.

—-

The updating version is available at http://canadia.strafenet.com/index.php?title=Programmer%27s_Thesaurus

3 comments.

back with slack

Posted on September 11th, 2007 by Chengstein.
Categories: Games, Minesweeper.

112expert8.PNGmy touchpad is taking HGH. My objective is to get to under 110 now.

CHENGSTEINIUM

0 comments.

Dun, Dee, Fried

Posted on September 11th, 2007 by Tim.
Categories: Minesweeper.

(Chengstien makes a new canadia record)

0 comments.

SWEEEEEP a MEEEEEEPHEUS

Posted on July 15th, 2006 by Chengstein.
Categories: Games, Minesweeper.

Sweeper, 121 secondsdundeefied, meepheus gets 121 on expert.

0 comments.