ambiguating new declaration of 问题的解决

    xiaoxiao2025-06-06  14

    今天在运行代码的时候 ,一直在报这样的错误

    ambiguating new declaration of ‘int NewPartition(seqlist*, int, int)’

    查看了许久 原来是头文件中的声明类型与函数实现的声明类型不一致造成的 这是在头文件中声明的是void

    void NewPartition(seqlist *l,int low,int high);

    但是在函数实现的代码中写成了

    int NewPartition(seqlist *l, int low,int high){

    这两者不一致 才会报错. 只需要将头文件中的函数声明改为void即可

    最新回复(0)