I'm trying to write simple program that reads stuff from files and write it to other file, there is no problem here.
However when i try to open file with space in name or directory it just won't work. e.g "C:\Program Files\filename.txt""C:\file name.txt"
This is what I use to check if file exist and similar to actually open file.
My bad, looks like I didn't check it properly when you type in file name that is in the same directory as executable then indeed it works, however it does not if you type whole directory and in either file name or directory is space somewhere.
In a literal string the '\' character is interpreted as an escape code to allow you to embed characters that otherwise cannot be entered or are nonprintable. For example to embed a newline in a literal string you cannot just hit the Enter key while typing the literal string because the editor would respond by actually starting a new line. So instead you type "\n", i.e., "This is on the first line\nThis is on the second line". To enter a '\' character you need to escape it by entering two slashes. The first slash is the escape character and the second slash is the slash character being embedded.
Indeed when I doubled slashes AND removed " from begging and ending of name string that were automatically added when drag and doping into program window it worked as intended.