Archived

This topic is now archived and is closed to further replies.

masonium

Straight console programs and DOS-based timing functions

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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().

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites