关于字符串有关的指针

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char* s=malloc(sizeof(char)*100);
    scanf("%s",s);        //指针变量就相当于地址 
    printf("%s",s);        //打印的是字符串s 
    return 0;
}

 

posted on 2023-10-31 14:25  四马路弗洛伊德  阅读(11)  评论(0)    收藏  举报

导航