编译C程序时出现“函数原型是ANSI功能”错误

问题描述

我正在尝试在旧的HP 3000 MPE / iX计算机系统上调试编译器错误。错误是:

cc: "func.c",line 8: error 1705: Function prototypes are an ANSI feature.
cc: "func.c",line 15: error 1705: Function prototypes are an ANSI feature.

代码如下。衷心感谢您的帮助:

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

#define MAX_LEN 80

int find_length( char *string )
{
   int i;
   for (i =0; string[i] != '\0'; i++);
   return i;
}

int main( void )
{
   char string[132];
   int result;
   int again = 1;
   char answer;
   printf( "This program finds the length of any word you ");
   printf( "enter.\n" );
   do
   {
      printf( "Enter the word: ");
      fflush(stdin);
      gets( string );
      result = find_length( string );
      printf( "This word contains %d characters. \n",result);
      printf("Again? ");
      scanf("%c",&answer);
   } while (answer == 'Y' || answer == 'y');
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)