#include <iostream>
#include <algorithm>
using namespace std;
int main () {
cout << "min(1,2)==" << min(1,2) << endl;
cout << "min(2,1)==" << min(2,1) << endl;
cout << "min('a','z')==" << min('a','z') << endl;
cout << "min(3.14,2.72)==" << min(3.14,2.72) << endl;
cout << "max(1,2)==" << max(1,2) << endl;
cout << "max(2,1)==" << max(2,1) << endl;
cout << "max('a','z')==" << max('a','z') << endl;
cout << "max(3.14,2.72)==" << max(3.14,2.72) << endl;
return 0;
} // main()
--------------------Configuration: Cpp2 - Win32 Debug--------------------
Compiling...
Cpp2.cpp
D:\My Documents\Program\C\Test\Cpp2.cpp(8) : error C2065: 'min' : undeclared identifier
D:\My Documents\Program\C\Test\Cpp2.cpp(13) : error C2065: 'max' : undeclared identifier
Error executing cl.exe.
Cpp2.obj - 2 error(s), 0 warning(s)
//--------------------------------------------------
Because they are not in VC6 "algorithm" ?
Last edited on
Wow~ reply so soon...
Thanks :)