c - Can't call system with white space in parameter -


i'm trying make system call work. it works in case there no space in address, doesn't work if there's space in address...

this call copies file 1 place another.

how escape space in code properly?

char buffer[300]; snprintf(buffer, sizeof(buffer), "copy %s\\%s %s", assistpath, apifilename, path); system(buffer); 

space matter? why don't try code?

snprintf(buffer, sizeof(buffer), "copy \"%s\\%s\" \"%s\"", assistpath, apifilename, path); 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

Kivy: Swiping (Carousel & ScreenManager) -

jdbc - Not able to establish database connection in eclipse -