請問沒有在定義變數時就進行賦值,之后怎樣將漢字字符賦給字符變數呢
uj5u.com熱心網友回復:
malloc()分配記憶體,strcpy()拷貝字串uj5u.com熱心網友回復:
#include <bits/stdc++.h>using namespace std;
const int inf=0x3f3f3f3f;
int main()
{
char a[20],b[20];
scanf("%s",a);
strcpy(b,a);
printf("%s",b);
return 0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/74507.html
標籤:新手樂園
