20 년 된 DOS 시스템에서 GNU Linux 시스템으로 이전 코드를 이전하려고합니다. 헤더 파일 중 몇 곳 (장소 전체에 포함되어 있음)에는 선언하고 초기화하는 구조체 구조체가 있습니다. 레거시 코드가 작성된 방식으로 컴파일 할 때 경고가 표시됩니다. 동일한 헤더 파일 안에 머물러야 어떻게 작동하는지 알 수 있습니다.C에서 헤더 파일 내부에 구조체의 구조체를 초기화하는 방법은 무엇입니까?
다음은 내가하는 일을 단순화 한 예입니다.
struct A
{
struct B temp1;
struct C temp2;
};
struct B
{
int temp3;
int temp4;
int temp5;
};
struct C
{
int temp6;
int temp7;
int temp8;
};
//These are the variables in how they are related to the initialization below
//struct A test_one = {{temp3,temp4,temp5},{temp6,temp7,temp8}};
struct A test_one = {{1,2,3},{4,5,6}};
경고는 무엇입니까? – OrangeDog