ํ์์ 21์ธ๊ธฐ, ์ ์์ 20์ธ๊ธฐ, ํ๊ต๋ 19์ธ๊ธฐ. -- ํ ๊ณ ๋ฑํ๊ต ๊ต์ฌ์ ์ธ์ฉ๊ตฌ์ . ์์ ์ ์ ๋ฌธ์์ ์ฝ์ ์ ์ด ์๋๋ฐ, ๊นํ๊ธธ ์์์ด ํ ๋ง์ด๋ผ๊ณ ๊ธฐ์ตํฉ๋๋ค. :)
๏ปฟ * ์ฌ๊ธฐ์๋ ๊ฐ๋จํ ํํธ๋ง์ ๋๋ ธ์ต๋๋ค. ๋ฐ๋ณต๋ฌธ๊ณผ ๊ฐ๋จํ ๊ตฌ์กฐ์ฒด๋ฅผ ์ฌ์ฉํ๋ฉด ์์ ๋ง๋ค์ ์์๊ฑฐ๋ผ ์๊ฐํฉ๋๋ค.
- 1~10์๊น์ง๋ฅผ ์ ์ฅํ๋ ํจ์๋ฅผ ๋ง๋ค์ด๋ณด์ธ์.:)
๊ฐ๋จํ 1๋ฒ ์์๋ฅผ ๊ธฐ๋กํ๋ ์์ #
char buf[256]; GetCurrentDirectory(255, buf); strcat(buf, "\\hiscore.ini"); DeleteFile(buf); WritePrivateProfileString( "1", "name", "๊ถํ์ธ", buf ); WritePrivateProfileString( "1", "score", "1234", buf );
1๋ฒ ์์๋ฅผ ์ฝ์ด๋ค์ด๋ ์์ #
char buf[256];
GetCurrentDirectory(255, buf);
strcat(buf, "\\hiscore.ini");
char name[255];
int score;
GetPrivateProfileString("1", "name", "", name, 255, buf);
score = GetPrivateProfileInt("1", "score", -1, buf);
sprintf(buf, "์ ์:%d", score);
MessageBox(NULL, name, buf, MB_OK);
๊ด๋ จ ํจ์ ์ค๋ช #
GetCurrentDirectory() - ํ์ฌ ๋๋ ํ ๋ฆฌ๋ฅผ ๋ฌธ์์ด๋ก ์ป์ด๋
๋๋ค.
DeleteFile() - ์ง์ ํ ํ์ผ์ ํ๋๋์คํฌ์์ ์ง์๋๋ค. ํด์งํต ๋ณต๊ตฌ ๋ถ๊ฐ๋ฅ์ด๋ ์ฃผ์ํ์ธ์.
WritePrivateProfileString() - ์ง์ ํ INI ํ์ผ์ ๊ฐ์ ๊ธฐ๋กํฉ๋๋ค.
GetPrivateProfileInt() ์ง์ ํ INI ํ์ผ๋ก๋ถํฐ ํญ๋ชฉ๊ฐ์ ์ ์ํ์ผ๋ก ์ฝ์ด๋ค์
๋๋ค.
GetPrivateProfileString() ์ง์ ํ INI ํ์ผ๋ก๋ถํฐ ํญ๋ชฉ๊ฐ์ ๋ฌธ์์ด๋ก ์ฝ์ด๋ค์
๋๋ค.
- ini ํ์ผ ํจ์ ์ฌ์ฉ์ ์ฃผ์์
- ์ ์ฒด ๊ฒฝ๋ก๋ก ํ์ผ๋ช ์ ์ง์ ํ์ง ์์ผ๋ฉด WINNT ์์คํ ๋๋ ํ ๋ฆฌ์ ์์ฑ๋ฉ๋๋ค.
- ์ผ๋จ ์์ฑ๋ ํญ๋ชฉ์ ์ง์์ง์ง ์์ต๋๋ค. ๊ทธ๋ฌ๋ฏ๋ก ๊ฐ๊ธ์ ๋งค๋ฒ ํ์ผ์ ์ง์ฐ๊ณ ๋ค์ ์์ฑํ๋ ๊ฒ์ด ์ข์ต๋๋ค.









