Add 2 CString datatypes

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi!<br/>Please take a look at the code snippet below. I am trying to add two CString variables but am not getting the desired output. Please let me know where I am going wrong.<br/><br/><span style="font-size:x-small;color:#0000ff <span style="font-size:x-small;color:#0000ff
filePath = filePath + scriptFileName; // This statement does not add scriptFileName to filePath.<br/>It only prints out the filePath variable.<br/><br/>What am I missing here. any help will be greatly appreciated. <br/>Thanks in advance<br/>ruchira
<pre><span style="font-size:x-small <span style="font-size:x-small <font size=2> CString scriptFileName = </font> <span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 ""<span style="font-size:x-small ;<font size=2> CString filePath = </font> <span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 ""<span style="font-size:x-small ;<font size=2><font size=2> </font><br/>printf(</font> <font size=2> <br/>printf( </font> <span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 "nnEnter script file name "<span style="font-size:x-small );<font size=2> scanf( </font> <span style="font-size:x-small;color:#800000 <span style="font-size:x-small;color:#800000 "%s"<span style="font-size:x-small , scriptFileName); <br/><br/>char cwdBuffer[256];
_getcwd(cwdBuffer, 256);
CString path(cwdBuffer);
filePath = path + "\";
filePath = filePath + scriptFileName; // This statement does not add scriptFileName to filePath.
printf("%snn",filePath);[/code]
<font size=2 color="#0000ff <font size=2 color="#0000ff

</font></font><font size=2 color="#0000ff

</font>


View the full article
 
Back
Top