上でやりたいのは、こういう事なんですが

#include <stdio.h>
#include <stdlib.h>

char *g_pcX;

int sub001(char *pcX)
{
pcX = (char*)malloc(256);
for(int i=0; i<256; i++)
{
pcX[i] = i;
}
return 0;
}


void main()
{
sub001(g_pcX);

for(int i=0; i<256; i++)
{
printf("%d ", g_pcX[i]);
}
}