Stroustrup chapter 2 Draw()??

In the exercises at the end of chapter 12 the exercises call for drawing various
shapes. There's nothing in the text of chapter 12 which discusses using draw() at all. Where can I find the documentation on how to use draw()??? Or can anyone give a short summary of drawing in this capacity???

Link? Book? ???

From chapter 12.4, second paragraph:
The G U I toolkit that we are using (indirectly for now) is called FLTK (Fast
Light Tool Kit, pronounced "full tick") from
I'm not sure I understand though. Draw features are from FLTK? Stroustrup's headers and .cpp files from his website, or from some other library in visual studio?

I see your point admkrk. This seems to have the answer, I hope it does.. Thanks for your help.
I have the book but haven't read it yet, I just quickly scanned the chapter. I don't have FLTK though, so I really can't explain how parts of the library work. His website might have links to the library and that is where you got it from? None of his examples in that section will work without FLTK installed and he even says so farther on in chapter 12.8:
Getting this program to run requires more than the programs we have presented
so far. In addition to our code in main(), we need to get the interface library
code compiled and linked to our code, and finally, nothing will run unless the FLTK
library (or whatever GUI system we use) is installed and correctly linked to ours.

I might go through those sections in the next week or so because it looks interesting and relevant to a couple things I want to do, but I can't really explain more until I do.

I see. I installed the FLTK library. It's tough bc there's nothing in the book to account for the newer version of FLTK. But once you have it working, the exercises all call for "drawing", and there's nothing in the chapter(12) about using "draw" and nothing that references any other place. I"m kinda frustrated about this, since I learn on my own and I think Stroustrup should be smarter than to just leave his independent readers hanging like this.
> and there's nothing in the chapter(12) about using "draw"

In addition to FLTK, you need to download these files (and add them to your project).

Look at the header Graph.h for class Shape and derived classes of Shape.
Shape has a member function void draw() const;
there's nothing in the book to account for the newer version of FLTK

Stroustrup has made available the version of the FLTK he uses in his book (1.1.9) if you'd prefer to be totally in step with him.

This version of FLTK is also included in the Complete collection of code fragments (revised) found here:

Programming -- Principles and Practice Using C++


Last edited on
Hi guys, thanks for those links. That will save me a bunch of searching when I get ready to start on this.

I did do a little poking around and noticed he was using an older version, but haven't had time to look into it further.
Thanks guys! I'm so glad this thread got made.

I actually halted my progress in Stroustrup's PP&PUC++ book because I couldn't find those antiquated fltk headers that he uses.

I've been glumly doing other tutorials ever since. Now I can get back to my main text! only seems hard at first. Try this:

If you have any questions I"d be happy to help.

BTW all Stroustrup's header files can be copy pasted from his website! :)
Topic archived. No new replies allowed.