Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert a character array into a string in VC++
How to convert a character array into a string in VC++
1. Use CSTRING's GetBuffer function to return a head pointer that stores characters, use CHAR * to accept it, and then use subscript operation.

2. For example: char * ptr = str. get buffer();

Define an array to accept each character.

Cahr array [10] = "0";

char array[0]= ptr[0];

char array[ 1]= ptr[ 1];

You can also use a loop so that the array holds the characters in CSTRING.