Recently wrote a program to find such a problem#include #includestring.h>using namespacestd;voidReverseChar*str) { intlen=strlen (str); Char*p=str; Char*q=str+len-1; while(pq) {Chartemp=*p; *p=*Q; *q=temp; P++; Q--; }}intMain () {Char*n1="123";
Programming has been a headache recently. This type of conversion can be done by knowing that it can be switched, but it is always hard to remember. I will keep searching through the Internet and summarize it here. For future convenience, of course,
Conversion between string, CString, char *
Int to CString:CString. Format ("% d", int );...............................String to CStringCString. format ("% s", string. c_str ());C_str () is indeed better than data.....................................
The transformation between string,cstring,char*
int Turn CString:Cstring.format ("%d", int);...............................String Turn CStringCstring.format ("%s", String.c_str ());Using C_str () is indeed better than data ()........................
Summarize the various types of Unicode conversions that have recently been used, and encounter additional additions in the future:1. String Turn CStringString a= "abc";CString str=cstring (A.c_str ());Or Str.format ("%s", A.c_str ())2, int turn
2014-03-02 20:14The following error occurred while compiling the following code:CPP: Error C2664: "int sprintf_s (char *,size_t,const char *,...)": cannot convert parameter 2 from "const char [3]" to "size_t"What does this mean, please? How do I
Unicode (unified code, universal code, Single Code) is a character encoding used on a computer. It sets a unified and unique binary code for each character in each language to meet the requirements of cross-language and cross-platform text
int turn CString:Cstring.format ("%d", int);...............................String Turn CStringCstring.format ("%s", String.c_str ());Using C_str () is really better than data ()........................................char* Turn CStringCstring.format
first, analyze the idea of the program :1: start with the first element of S, match the 1th element in T, and if equal, match the i+1 element of s with the 2nd element in T, and so on, if all elements of T match, then return position I; otherwise,
In the C + + standard library of functions.
There are three functions that can convert the contents of a string into character arrays and c-string
1.data (), returns an array of strings without ""
2,C_STR (), returns an array of strings with "yes"
3,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.