hehejo
blöder Purist
Hallo, ich bin ja nicht ganz unbedarft in Sachen C++ aber das hier verstehe ich nicht.
Ich möchte etwas die STL austesten.
In der Arbeit funktioniert das alles - also was mach ich hier bitte falsch?
PHP-Code ist nur da, damit es schöner aussieht.
Ich möchte etwas die STL austesten.
In der Arbeit funktioniert das alles - also was mach ich hier bitte falsch?
PHP-Code ist nur da, damit es schöner aussieht.
PHP:
#include <vector>
#include <iostream>
using namespace std;
namespace DEF {
static const int iMAX_SIZE = 10;
static const string sDUMMY = "ich bin TEST!";
}
typedef vector<string> StringContainer;
typedef StringContainer::iterator sc_Iterator;
int main()
{
StringContainer box;
box.push_back("u");
box.push_back("e");
box.push_back("i");
box.push_back("o");
box.push_back("a");
ostream_iterator<string> out(cout, " ");
copy(box.begin(), box.end(), out);
sort(box.begin(), box.end(), less<string>());
copy(box.begin(), box.end(), out);
return 0;
}
Code:
[testStart] gcc -o main main.cpp
main.cpp: In function `int main()':
main.cpp:25: Fehler: `ostream_iterator' undeclared (first use this function)
main.cpp:25: Fehler: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:25: Fehler: expected primary-expression vor »>«-Zeichen
main.cpp:25: Fehler: `out' undeclared (first use this function)