TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Andrew Seeger
from: Roy McNeill
date: 1996-09-14 01:23:00
subject: A few questions

Hello Andrew



 AS> 2... A clock routine, to display the clock and continually updating

 AS> it, i guess i will eventually work it out, but some pointers (no

 AS> pun intended) would be much appreciated.



A simple way is to use Borland's gettime() function. Call it once

during startup, and save the seconds figure. In your program's main

idle loop, call gettime(), and compare the returned seconds with

the saved seconds. If they differ, update your time display.



Don't update the display every time the idle loop loops. Screen

writing can be very time consuming if overdone. If you have a

profiler, learn how to use it.



In this idle loop, you may be looking for keyboard input. If so,

make sure you are using a function that just tests for keyboard

activity and returns immediately if there is none. Many input

routines will run nonstop until they get what they want, and your

idle loop (and time display) will halt while this happens. This

caution applies to all routines called by the idle loop.



Find the library reference manual (*the* most important book once

you've got the hang of the language) and look up keyboard and i/o

routines. Write lots of little tiny programs to get the feel of

them.



 AS> 3... When i compile a program, i end up with a lot of compiler crap

 AS> at the end of the exe, which shows things like the paths and names

 AS> of the .c source code files etc. How can i clean this up to make it

 AS> more respectable?



You probably have an option like "include debugging info" turned on

in your compiler and/or linker options. This is needed to allow the

source-level debuggers (both the one built into the IDE, and the

somewhat better standalone one) to "see" the source code lines.

This roughly doubles the size of the .exe file, but some of that

stays on disk when the program runs - eg I have 1.1 meg .exe files

that run happily in 600k. Turn it off once you don't need to debug.



 AS> 5... Am i using the right compiler? So far Turbo C++ v3.0 appears

 AS> to be doing the job, but....??



That's a bit like walking into a bar and asking loudly "Which is

the best beer?" The Turbo books used to be quite good for learning,

although I haven't seen them recently. I would suggest, however,

keeping an eye on the portability of the functions you use. Borland

supplies many pc-specific functions that aren't in standard C or

C++. There's nothing wrong with using them, just be aware that they

may not be available when you change compilers.



Cheers



--- PPoint 1.88


* Origin: Silicon Heaven (3:711/934.16)
SEEN-BY: 711/808 934
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.