강의

멘토링

커뮤니티

Inflearn Community Q&A

geeneoning's profile image
geeneoning

asked

[All-in-One Introduction to Game Programming] C++ & Data Structures/Algorithms & STL & Game Mathematics & Windows API & Game Server

TextRPG

섹션2에서 TextRPG 질문있습니다!

Written on

·

852

0

아래의 코드처럼

main안에서 EnterLobby()를 호출하고

그 밑에도 EnterLobby() 함수 내용이 작성되어있는데

메인 상단에 void EnterLobby(); 를 또 해주는 이유는

int num;

int main()

{

num = 10;

}

이런식으로 작성할때처럼 EnterLobby() 함수 공간을 미리 할당해주기 위해서 하는게 맞을까요?!

void EnterLobby();

int main()
{
    while (true)
    {
        //입력
        //로직
        //출력
    }

    EnterLobby();
}

void EnterLobby()
{
    while (true)
    {
        cout << "-------------------------" << endl;
        cout << "로비에 입장했습니다!" << endl;
        cout << "-------------------------" << endl;

        //플레이어 직업 선택
        SelectPlayer();
    }
}

c++네트워크ue-blueprint게임수학windows-api

Answer 1

0

geeneoning님의 프로필 이미지
geeneoning
Questioner

앗..! 바로 뒷 강의에 해당내용이 나오네요 ㅎㅎ

geeneoning's profile image
geeneoning

asked

Ask a question