강의

멘토링

커뮤니티

Inflearn Community Q&A

jjmjjj031605's profile image
jjmjjj031605

asked

[MMORPG Game Development with C++ and Unreal Series] Part 1: Introduction to C++ Programming

Practice Problems (Snail)

연습문제(달팽이) 21분:59초 질문

Written on

·

351

0

int nextX = x+ dx[dir];로 선언해주셨는데, 만약에 cin >> N 값에 3을 입력하면 dir이 Right의 방향을 가리키고 있다가 down으로 nextX=3이 되면 방향이 전환된 후 int nextX = x+ dx[dir];을 거치면 nextX 가 2값을 갖게 되는 데 왜 그런지 잘 모르겠습니다..

연습문제질문C++

Answer 1

1

Rookiss님의 프로필 이미지
Rookiss
Instructor

코드에 답이 있습니다.
x와 dir가 어떤 값인지 breakpoint를 걸어서 살펴보시고
찬찬히 분석을 해보세요.

jjmjjj031605's profile image
jjmjjj031605

asked

Ask a question