易截截图软件、单文件、免安装、纯绿色、仅160KB

C程序设计语言习题5-1,运行时出现段错误,求解

源代码如下:
#include <ctype.h>
#include <stdio.h>

#define BUFSIZE 100

int  getch(void);
void ungetch(int);

/* getint:  get next integer from input into *pn */
int getint(int *pn)
{
    int c, sign, sawsign;

    while (isspace(c = getch()))  /* skip white space */
                                            ;
    if (!isdigit(c) && c != EOF && c != '+' && c != '-') {
        ungetch(c);    /* it's not a number */
        return 0;
            }

    sign = (c == '-') ? -1 : 1;
    if (sawsign = (c == '+' || c == '-'))
        c = getch();
    if (!isdigit(c)) {
        ungetch(c);
        if (sawsign)
            ungetch((sign == -1) ? '-' : '+');
        return 0;
              }

    for (*pn = 0; isdigit(c); c = getch())
   


相关问答:

c基础

#include <string.h>
#include <stdio.h>

void main()
{
int i;
char buf[]="abcde";
strncpy(buf,"abc",3);
for(i=0;i <5;i++)
printf(&q ......

eclipse3.5+cdt编译c有问题

编译普通的c没问题啊,但编译javah生成的就报错:
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oHelloWorld.o ..\HelloWorld.c
gcc -otest.exe HelloWorld.o
d:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../. ......

C 程序问题 (二) - C/C++ / C语言

问一下:
#include <stdio.h>
int main()
{
  char x, y, z;
  int i;
  int a[16];
  for(i=0; i<=16; i++)
  {
  a[i] = 0;
  ......

你们现在还在用C吗?C有前途吗?

你们现在还在用C吗?C有前途吗?
一定,并永远坚持

引用
一定,并永远坚持



有用。

楼主何出此言

楼主来c版问这个问题是踢馆用意吗哈哈

越来越冷是肯定的,完全淘汰倒也没那么容易

c ......

C里面的字符输入

C/C++ code:

#include<stdio.h>
void main()
{
unsigned int v,u;
char c1,c2;
scanf("%o,%o",&u,&v);
scanf("%c,%c",&c1,&c2);
printf( ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号