#8 build_menu returns user_inf struct?

오픈
stevet4 년 전을 오픈 · 0개의 코멘트
Steve Thielemann 코멘트됨, 4 년 전

In cpp, I think it would be better written as:

void build_menu(user_inf &my)

Pass the my variable by reference. Meaning, it can be directly modified by the function.

In c, you would defined the function as user_inf * my, and my->metal, etc. to access and change the values.

As this is, you're letting the compiler handle the copying of the structure. (Did you intend for copying to be going on?)

In cpp, I think it would be better written as: ```c void build_menu(user_inf &my) ``` Pass the __my__ variable by reference. Meaning, it can be directly modified by the function. In c, you would defined the function as user_inf * my, and my->metal, etc. to access and change the values. As this is, you're letting the compiler handle the copying of the structure. (Did you intend for copying to be going on?)
로그인하여 이 대화에 참여
마일스톤 없음
담당자 없음
참여자 1명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.