请看看,C编译错误 [英] qlease at look,C by compile error

查看:105
本文介绍了请看看,C编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的节目源代码。



This is my program souce code.

#include <stdio.h>
#define MAXLINE 100 //most input

int compare1(int savewl[]);//  array name  of save and the first character of the word and the line.

void getcl(int savewl[],int next)   //get by the character length,save to array
{
  int i,c;

  for(i = 0;(c = getchar())!= EOF;++i)
    if(c == '\n'){
      ++next;
      i = 0;
    }
    else
      savewl[next] = i;
}

main() //print to everyone word length
{
  printf("How many the number is \n");

  int next,i;
  int save[MAXLINE];
  next = 0;

  getcl(save,next);
  next = compare1(save);
  for(i = 0;i <= next;++i)
    printf("H");

  return 0;
}

int Compare1(int s[]) //compare character. compositor
{
  int n1,n2,r;  //next and reture
  r = 0;

  for(n1 = 0;n2 <= MAXLINE;++n1)
    for(n2 = 1;n2 <= n1;++n2)
      if(s[n1] > s[n2])
    r = s[n1];
      else
    if(s[n1] < s[n2])
      r = s[n2];
    else
      ;
  return r;

}





错误:函数'main'未定义引用'compare1'



请帮帮我



error: In function 'main' undefined reference to 'compare1'

please help me

推荐答案

C区分大小写:compare1与Compare1不同

更改要调用的函数的名称以匹配函数声明。

C is case sensitive: "compare1" is not the same as "Compare1"
Change the name of the function you are calling to match the function declaration.
next = Compare1(save);


非常感谢您的回答。


这篇关于请看看,C编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆