typedef struct
에 비슷한 구조의 다른 배열 struct
을 어떻게 할당합니까?typedef 구조체에 구조체 배열 할당
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int age;
int height;
} Person[3];
struct internalStruct {
int age;
int height;
};
int main(void) {
//Possible
Person bob = {{7,5},{4,2},{4,3}};
//Is it possible to assign array to struct?
struct internalStruct intr[3] = {{4,32},{2,4},{2,4}};
Person job = intr; // Does not work :(.
printf("%d", jon[0].height);
return 0;
}
'struct internalStruct {int age; int 고도; }; typedef struct internalStruct Person [3];'? –
그냥 메모리 구조를 동일한 경우 (3 배열의 typedef 같은 구조를 잘 구조체 3 일반 배열입니다 이해하려고 노력하고 있어요. 난 실제로 C에서 코딩 오전 오전. – Anonymous