| mferarri (6) | |
|
Hi all, I am learning to code in c++ on Linux Mint 13. I am going through an exercise drill in a book called "Programming Principles and Practice using c++ by Bjarne Strustrup". I have a couple of questions. I am having trouble with the calling the error function mentioned below. Have your program write "I hear you just had a birthday and you are age years old." If age is 0 or less or 110 or more, call error("you're kidding!"). (It is Drill no5. on pg83 if anyone has access to the book) Also, I think Bjarne is using a Windows machine to do these exercises. Ones I've encountered sofar: keep_window_open() Does this mean that I have to find alternative functions to the ones mentioned in the book? and is there any website where I can find alternative funtions for windows ones (on a beginners level?) thanks in advance, | |
|
|
|
| AleaIactaEst (99) | |
|
You could replace the error function with a call to printf, and if you want the program to stop just call abort afterwards (http://www.cplusplus.com/reference/clibrary/cstdlib/abort/) And about functions like keep_window_open()... well i do not know what that's supposed to do, maybe you can simply remove it and you program runs fine. | |
|
|
|
| Athar (4382) | |
| IIRC, he provides a file named something along the lines of std_lib_facilities.h, which you're supposed to include in your programs. It likely contains the functions you're missing. | |
|
|
|
| mferarri (6) | |||
Thanks Athar, but I couldn't get std_lib_facilities.h to work. I copied this header from his website and put it in the same folder, but my compiler gives this error:
| |||
|
|
|||
| modoran (1101) | ||
|
This is a warning, not an error. To disable it, you just need to do this:
Just curious, what is the contents of std_lib_facilities.h ??? | ||
|
Last edited on
|
||
| mferarri (6) | ||
see this link: http://www.stroustrup.com/Programming/std_lib_facilities.h | ||
|
|
||