課程
/后端開發(fā)
/C
/C語言入門
在敲printf時候,字符串那個位置該怎么表示,字符串后面表示地址那個位置該怎么敲代碼
2016-10-20
源自:C語言入門 6-1
正在回答
輸出字符串:printf("%s\n",str);
例如:
#include<stdio.h>struct student{char a[20];char id[20];};int main(void){struct student str;printf("請輸入一個字符串:");scanf("%s",str.a);printf("輸入的字符串是:");printf("%s\n\n",str.a);}
字符串直接打在引號里面就行,假如需要輸出變量,直接用格式符? 逗號? 變量?
舉報
C語言入門視頻教程,帶你進(jìn)入編程世界的必修課-C語言
1 回答大佬江湖救急
4 回答江湖救急啊
2 回答各位大俠,江湖求救
1 回答大佬救急!?。?!
1 回答大神,救救我,
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-10-24
輸出字符串:printf("%s\n",str);
例如:
#include<stdio.h>
struct student{
char a[20];
char id[20];
};
int main(void)
{
struct student str;
printf("請輸入一個字符串:");
scanf("%s",str.a);
printf("輸入的字符串是:");
printf("%s\n\n",str.a);
}
2016-10-21
字符串直接打在引號里面就行,假如需要輸出變量,直接用格式符? 逗號? 變量?