捕鱼者 发表于 2014-4-8 10:43:28

帮忙指导错误

#include<stdio.h>
void main()
{
        floatpoint[]={{34.0,23.0,78.0,45.0},{56.0,67.0,89.0,56.0},{00.9,78.0,67.7,67.0},{98.7,67.9,45.6,35.5}};
        float (*pt);
        pt==point;
       
        int j,i;
       
        for(i=0;i<4;i++)
        {
                for(j=0;j<4;j++)
                        { if(*(pt+j)<60.00)
                                printf("The %d score%5.1f is faild:",i,*(pt+j));
                        }
       
        printf("\n");
        }
}
程序出错:
a.c: In function ‘main’:
a.c:6:4: error: invalid operands to binary == (have ‘float (*)’ and ‘float’)

求指导!

仰望天上的光 发表于 2014-4-8 11:35:08

pt==point;改为
pt=point;

pt=(float (*))&point;

陈俊杰1906 发表于 2014-4-8 12:31:00

路过围观一下

FXW 发表于 2014-4-8 12:39:29

pt==point;

捕鱼者 发表于 2014-4-8 14:27:56

仰望天上的光 发表于 2014-4-8 11:35 static/image/common/back.gif
pt==point;改为
pt=point;



谢谢啊!顺便问一下,论坛哪里有讲关于pt=(float (*))&point;这类的文章吗》
这一类的问题经常混起来?

捕鱼者 发表于 2014-4-8 14:28:27

陈俊杰1906 发表于 2014-4-8 12:31 static/image/common/back.gif
路过围观一下

一起学习哈:lol:

捕鱼者 发表于 2014-4-8 14:28:58

FXW 发表于 2014-4-8 12:39 static/image/common/back.gif
pt==point;

谢谢了啊!:lol:

湛蓝天空 发表于 2014-4-8 14:51:59

看看。。。。。。。。。。。。

杨学子 发表于 2014-4-8 17:52:58

float (*pt);
      pt=point;
      
页: [1]
查看完整版本: 帮忙指导错误