I've compiled this starting-up code (My stationary comp was damaged at the previous time):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include <string.h>
#include <iostream>
#include <map>
#include <utility>
typedef std::pair<std::int, std::int> strlines;
int main(){
// straight line is defined by:
// 1) coordinate of one line's point
// 2) angle slope
map<int, int> Line; // associative array
map<int, int>::iterator it; // iterator for access to Lines
Line.insert(strlines.dat);
for(it= Line.begin(); it!= Line.end(); ++it){
cout <<"Point's coordinate: : "<< (*it).first << " Angle slope of line: " << (*it).second << endl;
// Verify if coordinates of some points are same
if((it=Line.find()) == Line.end()){
std::cout<<"Point's coordinate is not in the map"<< endl;
} else{
cout << "Lines with similar coordinates are exist";
}
return 0;
}
|
And Builder show the following errors:
-------------------------------------------------------------------------------------
Build
[C++ Error] 02.CPP(6): E2272 Identifier expected
[C++ Error] 02.CPP(6): E2272 Identifier expected
[C++ Error] 02.CPP(13): E2451 Undefined symbol 'map'
[C++ Error] 02.CPP(13): E2188 Expression syntax
[C++ Error] 02.CPP(14): E2188 Expression syntax
[C++ Error] 02.CPP(16): E2451 Undefined symbol 'Line'
[C++ Error] 02.CPP(16): E2108 Improper use of typedef 'strlines'
[C++ Error] 02.CPP(18): E2451 Undefined symbol 'it'
[C++ Error] 02.CPP(19): E2451 Undefined symbol 'cout'
[C++ Error] 02.CPP(19): E2451 Undefined symbol 'endl'
[C++ Error] 02.CPP(29): E2134 Compound statement missing }