prog.c: In function ‘main’:
prog.c:6:24: error: ‘new’ undeclared (first use in this function)
unsigned char *pdata = new unsigned char[width*height*4];
^~~
prog.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
prog.c:6:28: error: expected ‘,’ or ‘;’ before ‘unsigned’
unsigned char *pdata = new unsigned char[width*height*4];
^~~~~~~~
prog.c:7:30: error: expected ‘,’ or ‘;’ before ‘unsigned’
unsigned char *rgbData = new unsigned char[width*height*3];
^~~~~~~~
prog.c:13:22: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
unsigned char d = pdata + (i*width*4 + j*4);
^~~~~
prog.c:14:4: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
memcpy(rgbData + (i*width*3 + j*3),d,3);
^~~~~~
prog.c:14:4: warning: incompatible implicit declaration of built-in function ‘memcpy’
prog.c:14:4: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
prog.c:14:40: warning: passing argument 2 of ‘memcpy’ makes pointer from integer without a cast [-Wint-conversion]
memcpy(rgbData + (i*width*3 + j*3),d,3);
^
prog.c:14:40: note: expected ‘const void *’ but argument is of type ‘unsigned char’