Straight console programs and DOS-based timing functions

Started by
5 comments, last by masonium 22 years, 3 months ago
1. Is there a way that you can make DOS only programs so that you can boot up your comp in DOS mode and run them? I''m using VC++, and I''m not sure if it''s because I''m including windows.h (no, this isn''t one of those fake-newbie questions). The only reason I''m including that is because I need GetTickCount, which brings me to my second question... 2. Are there any timing functions that return the time in milliseconds since the program started, like GetTickCount(), that are DOS-based or C/C++ standard? No, HTML is not an OO language.
Advertisement
Visual C++ console applications won''t run in DOS in the first place. They''re still Windows applications, albiet they''re in console mode, and still require Windows to run. If you want something that will generate DOS applications, go for DJGPP, Turbo C++, ect.

Johnny Watson
Owner/Main Programmer Vigasotech, Inc.
in DOS, (not windows), you can use this timer:

unsigned long far *clock = (unsigned long far*)0x000046CL;
so 0x000046CL holds the amount of time that has gone by in the program?


No, HTML is not an OO language.
Just to point out a subtle error, the address of the clock is actually 0x0000046C. You can leave out the L and you missed a 0. That''s one reason I don''t miss DOS at all.

And, if you''re looking for the ANSI way to do things, look up the function clock().

==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
thanks the clock function was exactly what I needed


No, HTML is not an OO language.
TO POINT OUT AN ERROR?!

quote:Original post by NuffSaid
Just to point out a subtle error, the address of the clock is actually 0x0000046C. You can leave out the L and you missed a 0.


ok...
well, if you consider that the number is meaningful from right to left, and that 0x marks the type, then, including significant digits wouldnt effect the value. IT DID COMPILE!
(and i didnt forget the 0, i simply didnt type it...)
and the L makes it look more rounded, the way it leads off into the simicolon.

0x46CL is a clock incrimented by the system, not the program.
its can be kind of error-prone to use it in high level languages because they like to optimize out testing its value. (borland, anyways)

Edited by - evilcrap on January 6, 2002 9:16:30 AM

This topic is closed to new replies.

Advertisement