[ Prev ] [ Index ] [ Next ]

C

Created 星期六 10 四月 2010

时间

<ctime>

time_t t1;
struct tm t2;
time(&t1);
t2=*localtime(&t1);
int year,month,day;

year=t2.tm_year+1900;
month=t2.tm_mon+1;
day=t2.tm_mday;
struct tm的成员中
int tm_year;//自1900年的年数
int tm_month;//自1月份的月数,取值(0,11)
int tm_mday;//一月的中的第几天

调用程序

在<cstdlib>中的

int system(const char * s);
将字符串s传递给系统执行

获取系统环境变量

<cstdlib>

char* getenv(const char* name);

整数

floor(x) :不大于x的最大整数
ceil(x):不小于x的最小整数