raw파일좀 도와주세요~~
풀큰
질문 제목 : 질문 내용 :
일단 제가 짠 소스로는요~~
#includestdio.h
#includestdlib.h
#define x_max 256
#define y_max 256
void main()
{
int *p,*q;
file *in, *out;
unsigned char in_data[x_max][y_max];
unsigned char out_data[x_max][y_max];
in = fopen(c:\\len256.raw, rb);
if (in == null) {
printf(file not found!!\n);
return;
}
fread(in_data, sizeof(char), x_max * y_max, in);
fclose(in);
p=(int*)malloc(sizeof(int));
q=(int*)malloc(sizeof(int));
for (*p = 0; *p y_max; ++(*p))
for (*q = 0; *q x_max; ++(*q))
out_data[*p][*q] = in_data[*p][*q];
out = fopen(c:\\len256_o.raw, wb);
fwrite(out_data, sizeof(char), x_max * y_max, out);
fclose(out);
}
이렇게 돼요~~
지금 제가 하고싶은건 저 for문을 이용해서
out_data에 가로 세로 모두2배크기로 확대된 사진을 저장하구 싶은데요~~
for (*p = 0; *p y_max; ++(*p))
for (*q = 0; *q x_max; ++(*q))
out_data[(*p)*2][(*q)*2] = in_data[*p][*q];
이렇게 하니까 에러뜨네요 ㅜㅜ 어떻게 해야될까요..