모바일 오유 바로가기
http://m.todayhumor.co.kr
분류 게시판
베스트
  • 베스트오브베스트
  • 베스트
  • 오늘의베스트
  • 유머
  • 유머자료
  • 유머글
  • 이야기
  • 자유
  • 고민
  • 연애
  • 결혼생활
  • 좋은글
  • 자랑
  • 공포
  • 멘붕
  • 사이다
  • 군대
  • 밀리터리
  • 미스터리
  • 술한잔
  • 오늘있잖아요
  • 투표인증
  • 새해
  • 이슈
  • 시사
  • 시사아카이브
  • 사회면
  • 사건사고
  • 생활
  • 패션
  • 패션착샷
  • 아동패션착샷
  • 뷰티
  • 인테리어
  • DIY
  • 요리
  • 커피&차
  • 육아
  • 법률
  • 동물
  • 지식
  • 취업정보
  • 식물
  • 다이어트
  • 의료
  • 영어
  • 맛집
  • 추천사이트
  • 해외직구
  • 취미
  • 사진
  • 사진강좌
  • 카메라
  • 만화
  • 애니메이션
  • 포니
  • 자전거
  • 자동차
  • 여행
  • 바이크
  • 민물낚시
  • 바다낚시
  • 장난감
  • 그림판
  • 학술
  • 경제
  • 역사
  • 예술
  • 과학
  • 철학
  • 심리학
  • 방송연예
  • 연예
  • 음악
  • 음악찾기
  • 악기
  • 음향기기
  • 영화
  • 다큐멘터리
  • 국내드라마
  • 해외드라마
  • 예능
  • 팟케스트
  • 방송프로그램
  • 무한도전
  • 더지니어스
  • 개그콘서트
  • 런닝맨
  • 나가수
  • 디지털
  • 컴퓨터
  • 프로그래머
  • IT
  • 안티바이러스
  • 애플
  • 안드로이드
  • 스마트폰
  • 윈도우폰
  • 심비안
  • 스포츠
  • 스포츠
  • 축구
  • 야구
  • 농구
  • 바둑
  • 야구팀
  • 삼성
  • 두산
  • NC
  • 넥센
  • 한화
  • SK
  • 기아
  • 롯데
  • LG
  • KT
  • 메이저리그
  • 일본프로야구리그
  • 게임1
  • 플래시게임
  • 게임토론방
  • 엑스박스
  • 플레이스테이션
  • 닌텐도
  • 모바일게임
  • 게임2
  • 던전앤파이터
  • 마비노기
  • 마비노기영웅전
  • 하스스톤
  • 히어로즈오브더스톰
  • gta5
  • 디아블로
  • 디아블로2
  • 피파온라인2
  • 피파온라인3
  • 워크래프트
  • 월드오브워크래프트
  • 밀리언아서
  • 월드오브탱크
  • 블레이드앤소울
  • 검은사막
  • 스타크래프트
  • 스타크래프트2
  • 베틀필드3
  • 마인크래프트
  • 데이즈
  • 문명
  • 서든어택
  • 테라
  • 아이온
  • 심시티5
  • 프리스타일풋볼
  • 스페셜포스
  • 사이퍼즈
  • 도타2
  • 메이플스토리1
  • 메이플스토리2
  • 오버워치
  • 오버워치그룹모집
  • 포켓몬고
  • 파이널판타지14
  • 배틀그라운드
  • 기타
  • 종교
  • 단어장
  • 자료창고
  • 운영
  • 공지사항
  • 오유운영
  • 게시판신청
  • 보류
  • 임시게시판
  • 메르스
  • 세월호
  • 원전사고
  • 2016리오올림픽
  • 2018평창올림픽
  • 코로나19
  • 2020도쿄올림픽
  • 게시판찾기
  • 오유인페이지
    개인차단 상태
    슴여슷님의
    개인페이지입니다
    가입 : 11-12-05
    방문 : 2442회
    닉네임변경 이력
    회원차단
    회원차단해제
    게시물ID : programmer_22726
    작성자 : 슴여슷
    추천 : 0
    조회수 : 1662
    IP : 123.140.***.149
    댓글 : 4개
    등록시간 : 2018/12/07 19:05:39
    http://todayhumor.com/?programmer_22726 모바일
    c언어 구조체 포인터 질문입니다 ㅠㅠ 도와주세요 ㅠㅠ
    옵션
    • 본인삭제금지
    <div><br></div> <div>typedef struct { // 재고 대장: 현재 보유하고 있는 Video 정보 저장  </div> <div><span style="white-space:pre;"> </span>char title[MAX_CHAR];</div> <div><span style="white-space:pre;"> </span>int qty; // 수량</div> <div>} VideoInfo;</div> <div><br></div> <div>void printAllVideo(VideoInfo videoList[], int videoCount)</div> <div>{</div> <div><span style="white-space:pre;"> </span>int i;</div> <div><br></div> <div><span style="white-space:pre;"> </span>printf("Video제목\t수량\n");</div> <div><span style="white-space:pre;"> </span>printf("-------------------------\n");</div> <div><span style="white-space:pre;"> </span>for (i = 0; i < videoCount; i++)</div> <div><span style="white-space:pre;"> </span>printf("%s\t%d\n", videoList[i].title, videoList[i].qty);</div> <div>}</div> <div><br></div> <div>void purchaseVideo(VideoInfo videoList[], int *videoCountPtr, char *title, int qty)</div> <div>{</div> <div><span style="white-space:pre;"> </span>*videoList[*videoCountPtr].title = *title;</div> <div><span style="white-space:pre;"> </span>videoList[*videoCountPtr].qty = qty;</div> <div><span style="white-space:pre;"> </span>*videoCountPtr += 1;</div> <div>}</div> <div><br></div> <div><br></div> <div>int main(void)</div> <div>{</div> <div><span style="white-space:pre;"> </span>int videoCount = 5;</div> <div><span style="white-space:pre;"> </span>VideoInfo videoList[MAX_VIDEO] = { {"BeforeSunrise", 1}, {"BeforeSunset", 3}, {"BeforeMidnight", 5}, {"Casablanca", 7}, {"EdgeOfTomorrow", 9} };</div> <div><span style="white-space:pre;"> </span>int rentCount = 0; // 현재 대출 건수는 0임</div> <div><span style="white-space:pre;"> </span>RentInfo rentList[MAX_CUST];</div> <div><br></div> <div><br></div> <div><span style="white-space:pre;"> </span>int choice;</div> <div><span style="white-space:pre;"> </span>int indexSearched;</div> <div><span style="white-space:pre;"> </span>char title[MAX_CHAR];</div> <div><span style="white-space:pre;"> </span>int custId, qty;</div> <div><br></div> <div><br></div> <div><span style="white-space:pre;"> </span>printf("1(All Video 출력), 2(구입), 3(검색), 4(대여), 5(All 대여정보 출력), 6(종료): ");</div> <div><span style="white-space:pre;"> </span>scanf("%d", &choice);</div> <div><br></div> <div><span style="white-space:pre;"> </span>while (choice != 6) {</div> <div><span style="white-space:pre;"> </span>switch (choice) {</div> <div><span style="white-space:pre;"> </span>case 1:</div> <div><span style="white-space:pre;"> </span>printAllVideo(videoList, videoCount);</div> <div><span style="white-space:pre;"> </span>break;</div> <div><span style="white-space:pre;"> </span>case 2:</div> <div><span style="white-space:pre;"> </span>printf("Enter video 제목: ");</div> <div><span style="white-space:pre;"> </span>scanf("%s", title);</div> <div><span style="white-space:pre;"> </span>printf("Enter video 수량: ");</div> <div><span style="white-space:pre;"> </span>scanf("%d", &qty);</div> <div><span style="white-space:pre;"> </span>purchaseVideo(videoList, &videoCount, title, qty);</div> <div><span style="white-space:pre;"> </span>break;</div> <div><span style="white-space:pre;"> </span>}</div> <div><span style="white-space:pre;"> </span>printf("1(All Video 출력), 2(구입), 3(검색), 4(대여), 5(All 대여정보 출력), 6(종료): ");</div> <div><span style="white-space:pre;"> </span>scanf("%d", &choice);</div> <div><span style="white-space:pre;"> </span>}</div> <div>}</div> <div><br></div> <div><br></div> <div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">질문 >>></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">1. purchaseVideo함수 안에서</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"> <div style="margin:0px;padding:0px;"><font size="2">*videoList[*videoCountPtr].title = *title;</font></div> <div style="margin:0px;padding:0px;"><font size="2">videoList[*videoCountPtr].qty = qty;</font></div> <div style="margin:0px;padding:0px;"><font size="2">*videoCountPtr += 1;</font></div></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">라고 적었는데 title은 videoList앞에 포인터 형식을 넣지 않으면 빨간줄이 뜨고</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">qty는 포인터 형식을 넣지 않아도 괜찮습니다. </font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">이건 왜 이러는 건가요? ㅠㅠㅠㅠ</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">2. purchaseVideo함수를 위처럼 정의하고 난 뒤 빌드업을 하면</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">디버그 창에서 2(구입)을 선택 후 제목과 수량을 입력받는데</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">예를 들어 입력을 </font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">제목: BeginAgain</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">수량: 10</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">이라고 입력한 후 AllVideo 출력을 다시 하면</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">(이미 저장되어 있는 것들은 다 정상적으로 뜨는데) </font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">B 10 이라고 뜹니다. 이건 왜 이러는 걸까요??ㅠㅠㅠ</font></div></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2"><br></font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">식이 너무 길어서 보기 귀찮으실 수도 있지만 한번만 도와주시면 감사하겠습니다 ㅠㅠ</font></div> <div style="margin:0px;padding:0px;font-family:'Helvetica Neue', 'Apple SD Gothic Neo', '나눔고딕', NanumGothic, '맑은 고딕', 'Malgun Gothic', '돋움', Dotum, sans-serif;"><font size="2">물어볼 곳이 없어서요 ㅠㅠ</font></div>

    이 게시물을 추천한 분들의 목록입니다.
    푸르딩딩:추천수 3이상 댓글은 배경색이 바뀝니다.
    (단,비공감수가 추천수의 1/3 초과시 해당없음)

    죄송합니다. 댓글 작성은 회원만 가능합니다.

    번호 제 목 이름 날짜 조회 추천
    c언어 구조체 포인터 질문입니다 ㅠㅠ 도와주세요 ㅠㅠ [4] 본인삭제금지 슴여슷 18/12/07 19:05 75 0
    20
    남자 기초템좀 추천해주실 수 있나요? [7] 본인삭제금지 슴여슷 17/11/04 00:20 101 1
    19
    6월의 뷰게의 텅장 (feat.기초) [9] 창작글 슴여슷 17/07/01 23:58 240 6
    18
    글로시데이 더말로지카 토너 수령했는데요 ㅠㅠ [7] 창작글 슴여슷 17/06/29 01:26 130 1
    17
    ☆★나도한다 발색샷★☆ (별거없음주의/아모레주의/방더러움주의/고양이주의) [9] 창작글 스물마흔다쨜 16/11/07 01:40 233 13
    16
    5s쓰는데 액정이 점점 들리고있이요 ㅠㅠㅠ [5] 스물마흔다쨜 16/09/26 17:12 97 0
    15
    텅장에 대한 뷰게의 난 ㄷㄷㄷ [7] 창작글 슴넷★ 15/10/17 00:56 155 1
    14
    오유 여징어분들!! 파데 추천좀요!! [6] 슴쓰리 14/12/03 15:28 94 0
    13
    다들 따땃한 겨울 보내고 있나 [10] 슴쓰리 14/11/28 22:09 130 14
    12
    커피찌꺼기 ... ㅎ.... [11] 슴쓰리 14/10/23 20:19 106 10
    11
    ㅇㅅㅇ [9] 슴쓰리 14/09/15 23:36 39 8
    10
    연아가 달성한 세계신기록 228점 전에 [2] 슴쓰리 14/02/21 09:23 325 3
    9
    (슴멎주의)새해맞이 연느풀기 [30] 슴둘 14/01/02 19:02 90 2
    8
    [나눔후기][닉언죄]밤비올레님의 나눔 후기요!!!!!뿌아아앙 [2] 슴둘 13/10/25 01:08 89 1
    7
    키작녀의 북흐북흐한 첫 착샷 [12] 슴둘 13/10/08 00:58 308 9
    6
    진격의 거인 9권 사러가여!!!! 율무차마싯서 13/05/02 17:24 70 0
    5
    하...수강신청 왜이렇게 빡셀까요.. [1] 율무차마싯서 13/03/06 14:25 43 0
    4
    시어머니 유느님ㅋㅋㅋ 율무차마싯서 13/02/14 04:48 66 0
    3
    Internet Explorer에서 웹 페이지를 표시할 수 없습니다. [1] 남친음슴ㅠㅠ 12/11/20 13:08 23 0
    2
    아기다리고기다리던 [8] 안냥 12/09/08 18:09 348 17
    1
    이 오빠 저를 좋아하는걸까요? [10] 순정여초 11/12/05 22:49 440 0
    [1]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈