728x90
๋ฐ์ํ
gcc ์๋์ฒ๋ผ ์ค๋ฅ๊ฐ ๋ ๋
undefined reference to __gxx_personality_v0'
warning: deprecated conversion from string constant to ‘char*’
์ฒซ๋ฒ์งธ ์๋ฌ๋
gcc -g -o server *.cc
๋ฅผ
g++ -g -o server *.cc
๋ก ๋ฐ๊พธ๋ฉด ํด๊ฒฐ๋จ.
๋๋ฒ์งธ ์๋ฌ๋
ํจ์๋ ๋ฐ์ดํฐ๋ฅผ ๊ต์ฒดํ๋ฉด ๋จ. ์๋ฅผ ๋ค์ด,
char* Str = "Hello";
๋ผ๋ฉด,
const char* Str = "Hello";
๊ทธ๋ฆฌ๊ณ
void DisplayText(char* Text);
๋ผ๋ฉด,
void DisplayText(const char* Text);
์ด๋ฐ ์์ผ๋ก ๊ณ ์น๋ฉด ์๋ฌ๊ฐ ๋์ง ์๋๋ค.
728x90
๋ฐ์ํ
'๊ฒ์ ํ๋ก๊ทธ๋๋ฐ > ํ๋ก๊ทธ๋๋ฐ ์ด๋ณด๊ฐ ๊ฒช๋ ๋ฌธ์ ๋ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
2021 ์นด์นด์ค ์ ์ ๊ณต์ฑ 1์ฐจ ์จ๋ผ์ธ ์ฝ๋ฉ ํ ์คํธ (0) | 2021.02.09 |
---|---|
hash_map<string, int> ์ฌ์ฉ์ ์ค๋ฅ๊ฐ ๋๋ค. (0) | 2021.02.06 |
C์ธ์ด ์๋ ์ธก์ ์ฉ ํ ํ๋ฆฟ (0) | 2021.02.06 |
for๋ฌธ๋ ๋ชจ๋ฅด๋ ๋ฐ๋ณด (0) | 2021.02.03 |
Segment Failed (or Fault) (0) | 2021.02.03 |