I need to dynamically create an array of integer. I\'ve found that when using a static array the syntax
int a [5]={0};
initializes correctl
int *a=new int[n]; memset(a, 0, n*sizeof(int));
That sets the all the bytes of the array to 0. For char * too, you could use memset. See http://www.cplusplus.com/reference/clibrary/cstring/memset/ for a more formal definition and usage.
char *