Klassenproblem
-
Screen empty; empty.cxy(2,5).csource('A');wenn ich das aufrufe, wieso stimmt das net?
//KLASSE: class Screen { public: typedef std::string::size_type index; //char get() const { return contents[cursor]; } char get(index ht, index wd) const; inline char get_cursor(index w, index h) const; char csource(char x) { some = x; } int cxy(int x, int y) { a = x, b = y; } private: int a, b; char some; std::string contents; index cursor; index width, height; };mfg
-
Erstmal, Fehlerbeschreibung wär hilfreich

Zweitens: cxy() gibt ein int zurück, bzw. gibst du das so an, aber gibst nichts zurück.
Allerdings ist int keine Klasse, und besitzt deswegen auch keine Methode 'csource()'
-
Hat sich gelöst...
-
jo statt:
empty.cxy(2,5).csource('A');
so:
empty.cxy(2,5);
empty.csource('A');