Warning C4047: '=': 'char' is different from indirection levels from 'char *'

What is the problem with the code below.

char filter[2] = {'\0'}; *filter = (char *)calloc((unsigned int)buf.st_size + 1, sizeof(unsigned char)); 

As I understand it, there are no problems with changing the location of the array? Why am I asking this because of a warning,

 Warning 1 warning C4047: '=' : 'char' differs in levels of indirection from 'char *' 

Any idea?

Got it, changed the code to. Thanks @ouah

 char *filter = {'\0'}; filter = (char *)calloc((unsigned int)buf.st_size + 1, sizeof(unsigned char)); 
+4
source share
1 answer

*filter is char , and you set it to char * .

+10
source

All Articles