std::string strSome = "AaBbCcDdEeFfGg"; // 대문자로.. std::transform(strSome.begin(), strSome.end(), strSome.begin(), toupper); // 소문자로.. std::transform(strSome.begin(), strSome.end(), strSome.begin(), tolower);
Posted by chungki
std::string strSome = "AaBbCcDdEeFfGg"; // 대문자로.. std::transform(strSome.begin(), strSome.end(), strSome.begin(), toupper); // 소문자로.. std::transform(strSome.begin(), strSome.end(), strSome.begin(), tolower);
Posted by chungki
#includestruct SPOINT3d { public: SPOINT3d() {} SPOINT3d(double _x, double _y, double _z) : x(_x), y(_y),z(_z) {} public: double x; double y; double z; }; typedef std::vector pointsettype; // Sort연산자 구조체 struct XSorter { bool operator(const SPOINT3d& p1, const SPOINT3d& p2) { return (p1.x 여기서 조건문을 바꾸면 y,z기준으로 혹은 역방향으로 Sorting이 가능하다. } }; void main() { pointsettype TPointSet; // 데이터 삽입 TPointSet.push_back(SPOINT3d(0., 0., 0.)); TPointSet.push_back(SPOINT3d(1., 0., 0.)); TPointSet.push_back(SPOINT3d(2., 0., 0.)); TPointSet.push_back(SPOINT3d(3., 0., 0.)); TPointSet.push_back(SPOINT3d(4., 0., 0.)); // Sorting std::sort(TPointSet.begin(), TPointSet.end(), XSorter()); }
Posted by chungki
Nice !!!!!!!!
- chungki
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 30 | 31 |