Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with CString

Status
Not open for further replies.

ThePooka

Programmer
May 26, 2003
3
0
0
IT
Hi all, i need to do 2 simple thing, but i don't know how, i'm a newbie on string handling in VC++

1) Creating a string like this: " Hello "World" "
a code like this give an error:
CString Test;
Test = _T(" Hello ""World"" ");

2) Putting in a string the CTRL+Z char (for using in AT commands)
Could i write: Test = _T("Hello^Z") ?

thx for help
 
Hi,
i hope the code can help you:

Code:
  CString k;
  k = _T("Hello ");
  k += '"' ; k+= '"' ; 
  k += "world";
  k += '"' ; k+= '"' ; 

  k += '\n';

  printf(k);
 

1) Creating a string like this: " Hello "World" "

To achieve this do this:
CString Test = " Hello \"World\" ";


ur second question is not clear.

Hope this helps
mathu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top