En teoria por pantalla me tendria que aparecer:
HelloWorld
CONSTRUCTOR
DEBERIA ENTRAR?
clase pruebas.cpp:
Código:
clase pruebas.h:using namespace std;
#include "pruebas.h"
int main(int argc,char *argv[])
{
cout<<"HelloWorld"<<endl;
Clase1 * c1 = new Clase1; //ACA ESTA EL ERROR!
c1.Hola(); //ACA ESTA EL ERROR!
return 0;
}
Código:
clase Clase1.cpp:using namespace std; #include "Clase1.h" #include <fstream> #include <iostream>
Código:
clase Clase1.h:#include "Clase1.h"
Clase1::Clase1()
{
cout<<"CONSTRUCTOR"<<endl;
}
void Clase1::Hola()
{
cout<<"DEBERIA ENTRAR?"<<endl;
}
Código:
los errores que me saltan por pantalla son:#ifndef _CLASE1_H_
#define _CLASE1_H_
#include <string.h>
#include <iostream>
using namespace std;
class Clase1
{
public:
Clase1();
void Hola();
};
#endif
pruebas.cpp:14: error: request for member `Hola' in `c1', which is of non-class type `Clase1*'
pruebas.cpp:17:2: warning: no newline at end of file
He mirado mucho por internet pero no doy con el error!!!!
Ayuda please. Mil gracias


