#define MAX 10
struct setArray
{
int item[MAX];
int count;
};
typedef struct setArray *BitSet;
我应该如何初始化结构中的元素?
例如
struct setArray s = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, MAX };
或者
struct setArray s;
for ( int i = 0; i < MAX; i++ ) s.item[i] = i;
s.count = MAX;
或者
BitSet p = malloc( sizeof( *p ) );
for ( int i = 0; i < MAX; i++ ) p->item[i] = i;
p->count = MAX;
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다