Home > Back-end >  Questions about the string
Questions about the string

Time:09-25

In do not define variables for assignment, then how to assign Chinese characters to character variables

CodePudding user response:

Malloc () allocates memory, strcpy () copy the string

CodePudding user response:

#include
using namespace std;
Const int inf=0 x3f3f3f3f;
Int main ()
{
[20] char a, b [20].
The scanf (" % s ", a);
Strcpy (b, a);
Printf (" % s ", b);
return 0;
}
  • Related