Coder's Guild Mailing List

Re: C++ questions by Shrapnel

Posted by Muhammad Ali Shah on 1999-08-08

>>How do you do color and graphics in C++?

It's imlementation and platform dependent. If you are using a Borland
product for DOS (ie. Turbo C++ or Borland C++), you can use the BGI
functions. However, they are very slow and not practical. If you are using
Microsoft C++, there are some different ones. In short this thing is not
standardized and the best way is to get a simple graphics library from the
internet (something like Alegro).


>> What's windows API?

Windows APIs are a set of functions already built up in the OS. They are to
Windows as service interrupts are to other programs. For example, if you
want to get the system directory (c:\windows), you can call the API directly
>from your code, without knowing the actual implementation.


>> How do you write programs that interact with computer hardware such
as printing?

Again you can get a hardware ports related library or write your own port
handling routines (difficult for a beginner). Moreover, operating system
also provide functions in this regard. You open a printer port and write to
it. I don't have details.


>>How do you do sound in C++?

There are simple functions as sound() and delay() but they can't take you to
far away. Again the solution is to get / write a set of functions that
handle the sound card.



For all your answers I would recommend: Teach Yourself Game Programming in
21 Days by Sams Publishing. You can perhaps read this book online at
www.mcp.com. Although DOS programming may be considered obsolette; learning
programming in DOS ain't.

All the best...
Muhammad Ali Shah
BCS IV - FAST Institute of Computer Science, Karachi.

Sponsored by Wrox Press - www.wrox.com. Programmer to Programmer (TM)