This code doesn't compile and i couldn't find why.
I work in visual c++ environment.
It gives these family of errors:
*syntax error : missing ';' before '->'
*'root' : missing storage-class or type specifiers
*'root' : 'int' differs in levels of indirection from 'class data *'
Thanks a lot for helping
*******************************************
#include <iostream>
#include <string>
using namespace std;
class data{
public:
data();
string myname;
};
data::data(){};
main(){
data *root=new data();
(root->myname)="/";
return 0;
}
********************************************