摘要: 先调用string的c_str(),函数,该函数一个指向正规C字符串的指针, 内容与本字符串相同,然后调用atoi()函数就可以了,下面是一个简单的测试程序:#includeusing namespace std; int main(){ string str = "12345"; cout << atoi(str.c_str())<<endl; return ;} 阅读全文
posted @ 2012-04-03 11:41 Tail。 阅读(374) 评论(0) 推荐(0) 编辑
摘要: #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 阅读全文
posted @ 2011-12-02 18:44 Tail。 阅读(1762) 评论(0) 推荐(1) 编辑
摘要: 这是博客园博客开通的第一天,又是一个良好的开始。 阅读全文
posted @ 2011-10-18 15:53 Tail。 阅读(142) 评论(0) 推荐(0) 编辑