How can I use the word string as a data type, like int? C++ does not support it? ? #define string char * ????? // some time it is wrong Suppose that I have a header file for a template class: dummy.h #ifndef DUMMY_H_ #define DUMMY_H_ // phototype template class dummy { dummy(); public: void read(); // void get_value(T&); private: T value; } // Implimentation ....... template void dummy::read() { cin>>value; } ....... #endif // test #define string char * main() { dummy name; // object name name.read(); // -> an error occurs ....... } Why is that? if I replace string by int dummy name; name.read() // NO PROBLEM I knew my fault.... cin>>name can't be used for char * (pointer) but I want to use string as a data type, so that I can declare: dummy name; Can you have me? thanks a lot....
ubri