0
구조체의 배열을 함수에 어떻게 보낼 수 있는지 알고 싶습니다.구조체의 배열이 C로 함수로 전달됨
typedef struct {
char fname[20];
char lname[20];
int cnumber[12];
} contact;
contact record[40];
int main()
{
// I have all the data in the record array as I am reading it from the
// file and want to pass the record array to the function PRINT and access it.
print();
}
어떻게 함수를 보내고 함수 호출을 사용하여 모든 값을 인쇄 할 수 있습니까?
또한 배열의 길이를 전달해야합니다. – army007
항목의 크기 (크기 아님)에 대해 왜 'size_t'입니까? –
@JohnColeman 무슨 뜻인지 확실하지 않습니다. 'size_t' 대신'int'가되기를 원하십니까? – RoadRunner