Rav*_*ven -1 c type-conversion
问题非常简单.如何转换char[]到一个char*用C?我真的很难找到解决方案.所以你的帮助非常感谢:)
这就是我需要这个的原因:
sprintf(name,"%c%c%%HACKED%c%c.virus",a,b,c,d); // print a formatted text to string (char[])
strcat(buffer,currentPath); // currentPath is of data type char[]
strcat(buffer,"\\");
strcat(buffer,name); // Now this is where the problem comes in. Since strcat function needs a const char* for it's second argument.
printf("%s",name);
Run Code Online (Sandbox Code Playgroud)