안녕 모두, 위의 이미지에서 . 컴파일 할 수 있지만 런타임에 프로그램이 중단됩니다. 이 문제를 해결할 수있는 해결책을 알려주십시오. 는 감사
// structArray.h : 당신은 t[1]
에 접속 만 t
하나 개의 항목이 있습니다
#ifndef __STRUCTARRAY_H_
#define __STRUCTARRAY_H_
typedef struct _vector{
int* str;
int maskSize;
// etc...
}__attribute__((__packed__)) _vector_t;
#endif /* _STRUCTARRAY_H_ */
**// do_structArray.c**
#include "structArray.h"
extern struct _vector_t t;
void do_structArray (void) {
int plaintext[2] = {0x05, 0x08};
_vector_t t[] = {
{plaintext, sizeof(plaintext)},
//{},
};
printf("Content: \n%x \n", t[1].str[1]);
}
// main : just calling do_structArray
#include <stdio.h>
#include <stdlib.h>
#include "structArray.h"
extern struct _vector_t t;
int main(int argc, char *argv[]) {
do_structArray();
system("PAUSE");
return 0;
}
죄송합니다. 늦은 밤의 프로그래밍이 내게 정말로 들어 있습니다. 이 말이 맞습니다. 도와 주셔서 감사합니다. –