Click here to Skip to main content
15,896,359 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to check whether the path selected is a drive name Pin
V K 227-May-09 19:23
V K 227-May-09 19:23 
AnswerRe: How to check whether the path selected is a drive name Pin
_AnsHUMAN_ 27-May-09 19:29
_AnsHUMAN_ 27-May-09 19:29 
AnswerRe: How to check whether the path selected is a drive name Pin
Rajesh R Subramanian27-May-09 22:07
professionalRajesh R Subramanian27-May-09 22:07 
AnswerRe: How to check whether the path selected is a drive name Pin
Stuart Dootson27-May-09 22:10
professionalStuart Dootson27-May-09 22:10 
Questionvc++ mfc( important please see it and reply me ) Pin
vkm198427-May-09 17:11
vkm198427-May-09 17:11 
AnswerRe: vc++ mfc( important please see it and reply me ) Pin
David Crow27-May-09 17:22
David Crow27-May-09 17:22 
QuestionCString replace function Pin
Muhammad Hassan Haider27-May-09 11:26
Muhammad Hassan Haider27-May-09 11:26 
AnswerRe: CString replace function Pin
Stuart Dootson27-May-09 13:46
professionalStuart Dootson27-May-09 13:46 
This question indicates you don't understand escaping and the role of backslashes in C string literals - when you enter a string in C/C++ source, the '\' character means 'step over the \ and treat the next character specially'

For instance, if you see \" in a C string literal, it means 'insert a double quote character' - as the double quote character is the string delimiter, this is the only way you can enter a double quote charcter.

This use of '\' means that you need to do something special to insert a '\' character in a string - that something special is '\\'.

So if you see this in some C/C++ code:

const char* path = "c:\\temp\\mypic.bmp";


what this means is that path will be assigned the address of the string c:\temp\mypic.bmp - note that the double backslash characters have been transformed to single backslashes.

So - your path doesn't need to be changed once it's in a CString - you can either assign the string literal version I showed above, or read the version with single backslashes using some form of user input, like this:

std::string path;
std::cin >> path;


I can enter c:\temp\mypic.bmp at the console window and that is what'll be assigned to path - no transformation of backslashes will happen from the command line.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: CString replace function Pin
David Crow27-May-09 16:57
David Crow27-May-09 16:57 
AnswerCString replace function Pin
Muhammad Hassan Haider27-May-09 22:24
Muhammad Hassan Haider27-May-09 22:24 
GeneralRe: CString replace function Pin
ThatsAlok28-May-09 6:07
ThatsAlok28-May-09 6:07 
QuestionThe strange behaviour of the text. Pin
daavena27-May-09 10:50
daavena27-May-09 10:50 
AnswerRe: The strange behaviour of the text. Pin
Nibu babu thomas27-May-09 18:13
Nibu babu thomas27-May-09 18:13 
QuestionDll - MFC - Customised browser Pin
rosemaried27-May-09 6:26
rosemaried27-May-09 6:26 
AnswerRe: Dll - MFC - Customised browser Pin
«_Superman_»27-May-09 22:08
professional«_Superman_»27-May-09 22:08 
Questionsizeof related in c/c++ Pin
hawk23reddy27-May-09 4:39
hawk23reddy27-May-09 4:39 
AnswerRe: sizeof related in c/c++ Pin
Emilio Garavaglia27-May-09 4:50
Emilio Garavaglia27-May-09 4:50 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 5:10
professionalStuart Dootson27-May-09 5:10 
GeneralRe: sizeof related in c/c++ Pin
Emilio Garavaglia27-May-09 7:41
Emilio Garavaglia27-May-09 7:41 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 7:53
professionalStuart Dootson27-May-09 7:53 
AnswerRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 4:58
professionalStuart Dootson27-May-09 4:58 
AnswerRe: sizeof related in c/c++ Pin
David Crow27-May-09 5:00
David Crow27-May-09 5:00 
GeneralRe: sizeof related in c/c++ Pin
hawk23reddy27-May-09 5:23
hawk23reddy27-May-09 5:23 
GeneralRe: sizeof related in c/c++ Pin
Stuart Dootson27-May-09 7:38
professionalStuart Dootson27-May-09 7:38 
AnswerRe: sizeof related in c/c++ Pin
«_Superman_»27-May-09 22:03
professional«_Superman_»27-May-09 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.