안녕하세요 여러분, 대부분의 프로그래밍이 C로 끝나는 인터뷰를 준비 중입니다. 객체가 어떻게 저수준 언어로 실제로 구현되는지 이해하기 위해 C로 연결된 목록 클래스를 구현하기로 결정했습니다. 이는 객체 지향 패러다임을 지원하지 않는다. 나는 컴파일에 관한 몇 가지 문제를 겪었으므로 C에 익숙한 사람이라면 누구든지 도와 주면된다 (나는 C로 프로그래밍 한 적이 없다). 아래 코드뿐만 아니라 컴파일 오류도 게시했습니다.C 프로그래밍 컴파일 문제
bash-4.1$ gcc -o LinkedList LinkedList.c
LinkedList.c:6: error: expected specifier-qualifier-list before ‘node’
LinkedList.c: In function ‘main’:
LinkedList.c:15: warning: incompatible implicit declaration of built-in function ‘malloc’
LinkedList.c:17: error: ‘List’ has no member named ‘next’
LinkedList.c: In function ‘insertEnd’:
LinkedList.c:24: error: ‘List’ has no member named ‘next’
LinkedList.c:25: error: ‘List’ has no member named ‘next’
LinkedList.c:27: warning: incompatible implicit declaration of built-in function ‘malloc’
LinkedList.c:29: error: ‘List’ has no member named ‘next’
LinkedList.c:30: error: ‘List’ has no member named ‘next’
LinkedList.c: In function ‘PrintList’:
LinkedList.c:36: error: ‘List’ has no member named ‘next’
C를 배우고 실습하는데 많은 시간이 걸립니다. 모든 경고와 디버그 정보 ('gcc -Wall -g')를 활성화하고 디버거 ('gdb')를 사용하십시오. 또한 '#include' –