string append with \ symbol
-
hi guys, i am developing a worm scanner.. i have to choose the directories from Folder Browser Dialog.. when i does that i will get the directory C:\NVIDIA\Win2KXP but i need to convert it to C:\\NVIDIA\\Win2KXP so that i can get the file names in the that directory using ListFiles...... since the symbol \ i could not put \ between "" and '' how can i solve this ya?? help me plz...
-
hi guys, i am developing a worm scanner.. i have to choose the directories from Folder Browser Dialog.. when i does that i will get the directory C:\NVIDIA\Win2KXP but i need to convert it to C:\\NVIDIA\\Win2KXP so that i can get the file names in the that directory using ListFiles...... since the symbol \ i could not put \ between "" and '' how can i solve this ya?? help me plz...
Thilek wrote:
but i need to convert it to C:\\NVIDIA\\Win2KXP so that i can get the file names in the that directory using ListFiles......
You don't need to convert it. You can use them straight. Only when you hard-code, you'll have to do this. Your question is slightly blurred to me though.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
-
Thilek wrote:
but i need to convert it to C:\\NVIDIA\\Win2KXP so that i can get the file names in the that directory using ListFiles......
You don't need to convert it. You can use them straight. Only when you hard-code, you'll have to do this. Your question is slightly blurred to me though.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
when i use C:\Private_Folder\forGetz its not seaching or getting the file name.. unless i use C:\\Private_Folder\\forGetz or C://Private_Folder//forGetz then its working :( but when i use folder browser dialog , i will be getting as C:\Private_Folder\forGetz....
-
when i use C:\Private_Folder\forGetz its not seaching or getting the file name.. unless i use C:\\Private_Folder\\forGetz or C://Private_Folder//forGetz then its working :( but when i use folder browser dialog , i will be getting as C:\Private_Folder\forGetz....
Are you using
std::string
to hold the value?Maxwell Chen
-
Are you using
std::string
to hold the value?Maxwell Chen
-
hi guys, i am developing a worm scanner.. i have to choose the directories from Folder Browser Dialog.. when i does that i will get the directory C:\NVIDIA\Win2KXP but i need to convert it to C:\\NVIDIA\\Win2KXP so that i can get the file names in the that directory using ListFiles...... since the symbol \ i could not put \ between "" and '' how can i solve this ya?? help me plz...
You must understand the difference between the hardcoded "\\" and thr "\" in the value of the variable. :doh: "\\": is an so calles 'escape sequence' FOR representing the "\" in the string. Look in the values of strings int the debugger :-O
Press F1 for help or google it. Greetings from Germany
-
You must understand the difference between the hardcoded "\\" and thr "\" in the value of the variable. :doh: "\\": is an so calles 'escape sequence' FOR representing the "\" in the string. Look in the values of strings int the debugger :-O
Press F1 for help or google it. Greetings from Germany
-
when i use C:\Private_Folder\forGetz its not seaching or getting the file name.. unless i use C:\\Private_Folder\\forGetz or C://Private_Folder//forGetz then its working :( but when i use folder browser dialog , i will be getting as C:\Private_Folder\forGetz....
Thilek wrote:
when i use C:\Private_Folder\forGetz its not seaching or getting the file name.. unless i use C:\\Private_Folder\\forGetz or C://Private_Folder//forGetz then its working
Because those are string literals, which must contain double backslahes.
Thilek wrote:
but when i use folder browser dialog , i will be getting as C:\Private_Folder\forGetz....
Which is correct.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
You must understand the difference between the hardcoded "\\" and thr "\" in the value of the variable. :doh: "\\": is an so calles 'escape sequence' FOR representing the "\" in the string. Look in the values of strings int the debugger :-O
Press F1 for help or google it. Greetings from Germany