난 그냥 cplusplus에서 일부 코드를 복사하고 wctomb
의 테스트 프로그램을 실행왜 MB_CUR_MAX가 정의되지 않았습니까?
/* wctomb example */
#include <stdio.h> /* printf */
#include <stdlib.h> /* wctomb, wchar_t(C) */
int main() {
const wchar_t str[] = L"wctomb example";
const wchar_t* pt;
char buffer [MB_CUR_MAX];
int i,length;
pt = str;
while (*pt) {
length = wctomb(buffer,*pt);
if (length<1) break;
for (i=0;i<length;++i) printf ("[%c]",buffer[i]);
++pt;
}
return 0;
}
그러나, 프로그램을 컴파일 할 수없는 MB_CUR_MAX는 지금까지 내 컴파일러 (VC 2010)로 간주됩니다 정의되지 않은 때문이다. 내가 뭘해야하는지 궁금해서. 감사!
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'buffer' : unknown size