摘要:
先调用string的c_str(),函数,该函数一个指向正规C字符串的指针, 内容与本字符串相同,然后调用atoi()函数就可以了,下面是一个简单的测试程序:#includeusing namespace std; int main(){ string str = "12345"; cout << atoi(str.c_str())<<endl; return ;} 阅读全文
摘要:
#include <stdio.h>#include <time.h> void main (){time_t rawtime;struct tm * timeinfo;time ( &rawtime );timeinfo = localtime ( &rawtime );printf ( "\007The current date/time is: %s", asctime (timeinfo) ); exit(0);}=================#include <time.h> -- 必须的时间函数头文件tim 阅读全文
摘要:
这是博客园博客开通的第一天,又是一个良好的开始。 阅读全文