SHAOXIAOJ正在加载中...

1178: 【实验8.1.4指针程序设计】

金币值:2 定数:5 时间限制:1.000 s 内存限制:128 M
解决:16 提交:26 正确率:61.54% 命题人:
点赞量:0 收藏量:0 题目类型:改错题 来源/分类: 指针

题目描述

下列程序的功能是使用字符指针输出字符串。修改程序,保证运行正确。

题目代码

#include <stdio.h>
#include <string.h>
    int main(void){ 
    char ch[30]="This is a test of point";
    char *p;
    p=&ch;                                    /*ERROR*/
    while(*p!='\n')                           /*ERROR*/
        putchar(p++);                       /*ERROR*/
    return 0;
}

样例输出    复制

This is a test of point