구조제 동적메모리 할당
글쓴이: asleea / 작성시간: 화, 2012/05/29 - 4:47오후
#include<stdio.h> #include<stdlib.h> typedef struct _Node { unsigned int number; struct _Node* prev; struct _Node* next; }Node; Node* head = (Node*)malloc(sizeof(Node)); Node* tail; int main() { return 0; }
malloc 부분에서 이니셜라이저가 상수가 아닙니다. 라는 에러가 뜨는데 머가 문제인가요 .?;;;
Forums:
메모리 할당 위치가..
malloc 할당은 int main() 함수 안에서 실행되어야 합니다.
c에서 함수 호출은 반드시 함수 안에서 수행
c에서 함수 호출은 반드시 함수 안에서 수행 되어야합니다.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
댓글 달기