/*C語言 以指標指向字串*/
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    char name[20];
    char* ptr = "Write your name:";

    puts(ptr);
    gets(name);
    printf("Hi,");
    puts(name);

    system("pause");
    return 0;
}

結果為:

image

arrow
arrow
    創作者介紹
    創作者 愛學習 的頭像
    愛學習

    愛學習

    愛學習 發表在 痞客邦 留言(0) 人氣()