}today;结构体里面是空的会报错么,别人的源代码是 struct date today,但这样写会报错,我就改成struct date{ }today,不知道这样会不会有错
6 个解决方案
#1
不会出错 别人的写法应该是
typedef struct date {
}today;
#2
,嗯,这个已经弄好了,那为什么引用了<time.h>和<dos.h>getdate()还是有错误
#3
struct tm *getdate(const char *string);
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source
The function getdate() converts a string representation of a date and
time, contained in the buffer pointed to by string, into a broken-down
time. The broken-down time is stored in a tm structure, and a pointer
to this structure is returned as the function result. This tm struc‐
ture is allocated in static storage, and consequently it will be over‐
written by further calls to getdate().
RETURN VALUE
When successful, getdate() returns a pointer to a struct tm. Other‐
wise, it returns NULL and sets the global variable getdate_err to one
of the error numbers shown below. Changes to errno are unspecified.
On success getdate_r() returns 0; on error it returns one of the error
numbers shown below.
Program source