首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在char指针中接受字符串输入

在char指针中接受字符串输入
EN

Stack Overflow用户
提问于 2013-02-05 20:20:39
回答 8查看 55.2K关注 0票数 12
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
    char *s;
    printf("enter the string : ");
    scanf("%s", s);
    printf("you entered %s\n", s);
    return 0;
}

当我提供长度不超过17个字符的小输入时(例如,“

我的编译器(代码块)或我的pc (Windows7)有问题吗?或者它以某种方式与C的输入缓冲区有关?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14707427

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档