๋‚ด ์ธ์ƒ์—์„œ ๋ฏฟ์„ ๊ฑด ์˜ค์ง ๋‚˜ ์ž์‹ ๋ฟ!

The only one you can truly trust is yourself.

๊ฒŒ์ž„ ํ”„๋กœ๊ทธ๋ž˜๋ฐ/ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์ดˆ๋ณด๊ฐ€ ๊ฒช๋Š” ๋ฌธ์ œ๋“ค

hash_map<string, int> ์‚ฌ์šฉ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋‚œ๋‹ค.

๐ŸŽฎinspirer9 2021. 2. 6. 01:57
728x90
๋ฐ˜์‘ํ˜•

2011๋…„... hash_map<string, int> ์‚ฌ์šฉ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋‚œ๋‹ค.

๊ตฌ๊ธ€๋ง์„ ํ•ด์„œ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ์‹์„ ์ฐพ์•„๋‚ด์„œ ํ•ด๋ดค๋Š”๋ฐ ๋‹ค ์†Œ์šฉ์—†์—ˆ๊ณ ,

์ปดํŒŒ์ผ ์˜ต์…˜๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๋˜๋Š” ๊ฑฐ ์˜€๋‹ค.

 

hash_map์ด ์•„์ง ํ‘œ์ค€์ด ์•„๋‹ˆ๋ผ์„œ ์ปดํŒŒ์ผ ํ•  ๋•Œ ์˜ต์…˜์„ ๋” ๋ถ™์—ฌ์ค˜์•ผ ํ•˜๋Š” ๊ฑฐ์˜€์Œ... ใ… .ใ… 

 

์ปดํŒŒ์ผํ•  ๋•Œ ์•„๋ž˜ ๋Œ€์‹ 

g++ -g -o s s.cc

์•„๋ž˜์ฒ˜๋Ÿผ ํ•˜๋ฉด ๋˜๋Š” ๊ฑฐ์˜€๋‹ค.

g++ -Wall -std=c++0x -o s s.cc

 

์•ˆ ๊ทธ๋Ÿฌ๋ฉด ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋‚œ๋‹ค.

/usr/include/c++/4.4/c++0x_warning.h:31:2 error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c_\++0x or -std=gnu++0x compiler options.

error: expected constructor, destructor, or type conversion before '<' token

๊ตฌ๊ธ€๋ง์— ์˜์กดํ•˜๋‹ค๋ณด๋‹ˆ ์ € ์œ„ ์ฒซ๋ฒˆ์งธ ๋ฌธ์žฅ๋งŒ ์ฝ์—ˆ์–ด๋„ ํ•ด๊ฒฐ๋  ๋‚ด์šฉ์„ ํ•œ์‹œ๊ฐ„์ด๋‚˜ ์ฐพ์•„ํ—ค๋งธ๋‹ค.

๋” ์›ƒ๊ธด ๊ฑด ๊ตฌ๊ธ€๋ง ๊ฒฐ๊ณผ์˜ ๋ฐฉ๋ฒ•๋“ค์ด ์œ„์™€ ๊ฐ™์ด ์ปดํŒŒ์ผ๋Ÿฌ ์˜ต์…˜ ๋ฐ”๊พธ๋Š”๊ฒŒ ์•„๋‹ˆ๋ผ STL ํ…œํ”Œ๋ฆฟ์„ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜ ํ•˜๋Š” ๊ฒƒ๋“ค์ด์—ˆ์Œ. ใ…‹ใ…‹ใ…‹

728x90
๋ฐ˜์‘ํ˜•