Menu

dos.h header file is not completed?????

2007-01-08
2012-09-26
  • Nobody/Anonymous

    i wish to use include the dos.h header file in my program but what i got is the message from dev-C++ 5.0 that telling me the header file doesn't have the function i want to use: gettime(&t)...
    but i can perfectly compile using borland turbo c++ compiler...wish soomeone can help me with this problem, thanks alot

     
    • Nobody/Anonymous

      oh ya for those who know how to fix this problem, please give me an email,thanks again

       
    • Anonymous

      Anonymous - 2007-01-08

      a) Answers are to be posted in the forum for the benefit of all, not e-mailed, this is not a personal support service
      b) How would any one e-mail you in any case, you need a sourceforge account to send e-mails by proxy, and it is not recommended that you post your address publically both because of (a) and because you will only invite spam.

      DOS is a largely obsolete operating system (where have you been!?), and the dos.h header is a hangover from old 16bit DOS compilers. The dos.h header provided with MinGW is a mimimalist subset intended to give some but not complete support for legacy code. You should not be relying on it for new code. It contains only those functions that can be implemented easily on a Win32 system and for which there is no suitable standard alternative.

      The ISO standard <time.h> (<ctime>) header provide standard time related functions. To essentially do the same as gettime() you need to use time() followed by localtime(), the latter fills a tm struct from a time_t value returned by time(): Example: http://www.cplusplus.com/reference/clibrary/ctime/localtime.html. The tm struct is as http://www.cplusplus.com/reference/clibrary/ctime/tm.html, note that it provides date information as well, so you don't need getdate() either.

      Clifford

       
    • Wayne Keen

      Wayne Keen - 2007-01-08

      I would also like to reinforce something that Clifford said. It is very
      much outside the decorum of this (and most any forum that I am aware of),
      to ask for an answer to be emailed to you.

      I wonder by the way, are you the person who asked about DOS programming
      several days ago?

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.