Time
C++
How do I set a variable equal to the date, almost like I want a program that displays the date?
#include <iostream>#include <string>#include <time.h>using namespace std;int main(){ time_t curr_time; time(&curr_time); string str = ctime(&curr_time); cout << str << endl; return 0;}
http://www.codersource.net/cpp_date_time.html
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement