请输入您要查询的百科知识:

 

词条 _strtime
释义

C语言中的_strtime函数

函数简介:

函数名: _strtime

头文件: time.h

函数原型: char * _strtime(char *)

功能: 获取当前系统时间(不包括日期),函数以字符指针形式为返回.

函数应用举例1:

#include<time.h>

#include<string.h>

#include<stdio.h>

#include <conio.h>

void main()

{

char Now_time[30];

char *t;

t=Now_time;

strcpy(Now_time,_strtime(t));

printf("%s",Now_time);

getch();

/*此形式一般用于理解*/

}

运行结果将打印出当前时间

函数应用举例2:

一般实用性的使用方法:

#include<time.h>

#include<stdio.h>

#include <conio.h>

void main()

{

char Now_time[30];

printf("%s",_strtime(Now_time));

getch();

}

运行结果将打印出当前时间

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/23 5:12:23