I have the following snippet of code:
time_t data1 = time(0)+86400;
struct tm * data_emprestimo = localtime( & data1 );
cout << "Hoje: " << data_emprestimo->tm_mday << '/' << (data_emprestimo->tm_mon + 1) << '/' << (data_emprestimo->tm_year + 1900) << endl;
It works well.
But I wonder what kind I should return in a function to get what cout echos and put on a variable: struct tm? Just tm? Array? String?
I've tried something like this:
struct tm retornaData(int segundosAdd);
...
...
struct tm retornaData(int segundosAdd){
return data_emprestimo;
}
but it did not work.
And I already googled that a lot!