I. Possible combinations:
(1) const char * P
(2) Char const * P
(3) char * const P(4) const char ** P
(5) Char const ** P
(6) char * const * P
(7) Char ** const P
Of course, there are several cases of inserting a const in (5), (6), and
One, possible combinations:(1) Const CHAR*P(2) Char Const*p(3) Char *const p(4) const char **P(5) Char Const**p(6) Char *const *p(7) Char **const pOf course, in (5), (6), (7) and then insert a const in a number of cases, but the analysis of the
About wchar_t
In the C ++ standard, wchar_t is a wide character type. Each wchar_t type occupies 2 bytes and has a 16-bit width. Wchar_t is required for the representation of Chinese characters. Char, we all know, occupies a byte, 8-bit width.
Constraints for assigning values according to ansi c:
1. Both operands are pointers to compatible types with or without delimiters.
2. the type pointed to by the Left pointer must have all the qualifiers of the type pointed to by the right
There are many C procedures, in the communication with the new members of the project found that generally for Char *s1 and Char s2[] know there are misunderstandings (think no difference), resulting in sometimes "difficult to understand" error. A
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.....................................
Original article address:Convert: char *,
Char []
, Cstring,
String Conversion
Author:Gisldq
(1) OverviewString and cstring are both string template classes. string is a string class defined by the standard template class (STL) and has been
See the Forum on the discussion of this issue, the feeling is also involved in a relatively broad, and many people have made this mistake, such as declaring char *p = "Hello world!"; I tried to change the string content with the P pointer, so I
Convert cstring to char *Cstring CSTR;Char * P = (lpstr) (lpctstr) CSTR;String to cstringCstring. Format ("% s", String. c_str ());Convert Char to cstringCstring. Format ("% s", char *);Char to stringString S (char *);String to char *Char * P =
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.