What is wrong with the following lines?
//Thanks to Mark
#include <string.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
char datfile[127];
if(argc < 2) return -1;
strcpy_s(datfile, strlen(argv[1]), argv[1]);
strcat_s(datfile, strlen(argv[1]) + 4, ".dat");
printf("%s\n",datfile);//the warning appears here (why?)
return 0;
}
It shows Warning C4047 'function': 'const char *' differs in levels of indirection from 'char'
I've gone through the documentation provided by MSDN for C4047
. It names a term called levels of indirection
. I've gone through some discussions related with this topic i.e. levels of indirection
in the web and (as a newbie) I found those beyond the scope of my radar.
I'd be very glad if someone points out the problem with the code above and provides a simply understandable explanation of the term level of indirection
.