Templateproblem
-
Hi, die variable shit wird nicht ausgegeben. Brauch ich nen überladungsoperator?
#include <iostream> using namespace std; template <class t> t rechner (t test1) { t shit; for (typename t :: iterator i=test1.begin (); i!=test1.end (); i++) { shit++; } return shit; } int main () { string bs = "Hallo"; string out = rechner (bs); cout << out; }
-
Doppelpost:
http://www.c-plusplus.net/forum/322037