Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/07/2011, 12:04
alexg88
 
Fecha de Ingreso: abril-2011
Mensajes: 1.342
Antigüedad: 13 años
Puntos: 344
Respuesta: Guardar hora y fecha local en variable

Tienes que poner la variable registro como char * (puntero a char).

Código C++:
Ver original
  1. #include <iostream>
  2. #include <ctime>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     char *registro;
  9.     time_t tAct = time(NULL);
  10. cout << "Tiempo actual: " << asctime(localtime(&tAct));
  11. registro=asctime(localtime(&tAct));
  12. cout<<registro;
  13.  
  14. system("pause");
  15.  
  16. return 0;
  17. }