|
From: Dondolo M. <MDo...@OL...> - 2003-02-05 14:00:35
|
Hi all,
Can anybody tell me what I am doing wrong. I get an error
"aggregate struct dos_date_t today has incomplete type and cannot be
initialised."
can some one please help me reconstruct the syntax
//program displaying the date and time
//
#include<iostream.h>
#include<stdlib.h>
#include<dos.h>
main()
{
struct dos_date_t today;
struct dos_time_t theTime;
dos_getdate( &today );
cout<<"The date is "<<(int)today.month
<<"/"<<(int)today.day<<"/"<<today.year<<"\n";
dos_gettime( &theTime);
cout<<"The time is "<<(int)theTime.hour<<":";
if(theTime.minute<10)
cout<<'0';
cout<<(int)theTime.minute<<":";
if(theTime.seconds<10)
cout<<'0';
cout<<(int)theTime.seconds<<"\n";
system("PAUSE");
return 0;
}
Mpho Dondolo
Support Analyst
CSC Computer Sciences (South Africa) (Pty) Ltd
Tel: +27 21 5030056
Cell: +27 84 3371468
Fax: +27 21 5095619
Email:MDo...@ol...
Email: MDo...@cs...
"How do you claim to have loved,
when you have never loved unconditionally"
|
|
From: Lucas K. T. <lk...@bo...> - 2003-02-05 14:58:42
|
I tohught that was it, but it wasn't, sorry, HelpPC gave me that = though... I still hadn't tested it... it doesn work either.... dammit... = hehehe I'll take another look at it later... lkt153 |
|
From: Ken B. <ke...@al...> - 2003-02-05 15:19:21
|
-----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Lucas K. Tavares Sent: Wednesday, February 05, 2003 9:56 AM To: DEV Cpp List Subject: [Dev-C++] Re: Time Display I tohught that was it, but it wasn't, sorry, HelpPC gave me that though... I still hadn't tested it... it doesn work either.... dammit... hehehe I'll take another look at it later... lkt153 [[Ken]: ] Please include the pertinent text you're replying to in your messages (it makes it easier to follow the flow.) And would you mind posting in plain text? Thanks, Ken Bradford Alpha II Service, Inc. (614)868-5033 |
|
From: Ken B. <ke...@al...> - 2003-02-05 15:28:53
|
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...]On Behalf Of Ken Bradford
Sent: Wednesday, February 05, 2003 10:22 AM
To: DEV Cpp List
Subject: RE: [Dev-C++] Re: Time Display
And would you mind posting in plain text?
Thanks,
Ken Bradford
Alpha II Service, Inc.
(614)868-5033
[[Ken]: ] can't believe I did that! Sorry.
Ken Bradford
Alpha II Service, Inc.
(614)868-5033
|
|
From: Lucas K. T. <lk...@bo...> - 2003-02-05 15:34:53
|
I'm already doing that, and sorry aout sending the e-mail directly to you, I forgot to change the recipient... hehehe lkt153 ----- Original Message ----- From: "Ken Bradford" <ke...@al...> To: "Dev-Cpp" <dev...@li...> Sent: Wednesday, February 05, 2003 1:31 PM Subject: RE: [Dev-C++] Re: Time Display > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Ken Bradford > Sent: Wednesday, February 05, 2003 10:22 AM > To: DEV Cpp List > Subject: RE: [Dev-C++] Re: Time Display > > > And would you mind posting in plain text? > > Thanks, > Ken Bradford > Alpha II Service, Inc. > (614)868-5033 > > [[Ken]: ] can't believe I did that! Sorry. > > Ken Bradford > Alpha II Service, Inc. > (614)868-5033 > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
|
From: Per W. <pw...@ia...> - 2003-02-05 14:32:09
|
If you look into dos.h, you'll notice that it doesn't contain any time
handling functions or structures, so obviously the compiler doesn't have
the faintest what "struct dos_date_t" is.
If you on the other hand take a look into time.h, you'll find a lot of
standard time-handling functions and structures there.
#include <iostream>
#include <time.h>
time_t t;
struct tm *local;
// alt 1
t = time(NULL);
cout << ctime(&t);
// alt 2
t = time(NULL);
local = localtime(&t);
std::cout << "local time is " << asctime(local);
std::cout << "gmt time is " << asctime(gmtime(&t));
std::cout << "current year is " << localtime.tm_year;
/Per W
On Wed, 5 Feb 2003, Dondolo Mpho wrote:
> Hi all,
>
> Can anybody tell me what I am doing wrong. I get an error
> "aggregate struct dos_date_t today has incomplete type and cannot be
> initialised."
>
> can some one please help me reconstruct the syntax
>
>
> //program displaying the date and time
> //
>
> #include<iostream.h>
> #include<stdlib.h>
> #include<dos.h>
>
> main()
> {
> struct dos_date_t today;
> struct dos_time_t theTime;
>
> dos_getdate( &today );
> cout<<"The date is "<<(int)today.month
> <<"/"<<(int)today.day<<"/"<<today.year<<"\n";
>
> dos_gettime( &theTime);
> cout<<"The time is "<<(int)theTime.hour<<":";
>
> if(theTime.minute<10)
> cout<<'0';
> cout<<(int)theTime.minute<<":";
>
> if(theTime.seconds<10)
> cout<<'0';
> cout<<(int)theTime.seconds<<"\n";
>
> system("PAUSE");
> return 0;
> }
> Mpho Dondolo
> Support Analyst
> CSC Computer Sciences (South Africa) (Pty) Ltd
> Tel: +27 21 5030056
> Cell: +27 84 3371468
> Fax: +27 21 5095619
> Email:MDo...@ol...
> Email: MDo...@cs...
>
> "How do you claim to have loved,
> when you have never loved unconditionally"
>
>
>
>
|
|
From: Lucas K. T. <lk...@bo...> - 2003-02-05 14:52:35
|
The name of that structure is dosdate_t, not dos_date_t, same goes for = doestime_t lkt153 |