为什么我会得到一个“所谓的对象0不是一个函数错误”? [英] Why am I getting a 'called object 0 is not a function error'?

查看:163
本文介绍了为什么我会得到一个“所谓的对象0不是一个函数错误”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C#开发人员努力学习C(其次是C ++)。我要去本地,使用vim作为我的文本编辑器在Ubuntu的工作,和GNU C编译器(GCC)编译。

I'm a C# developer trying to learn C (followed by C++). I am going native, working on Ubuntu using vim as my text editor, and the Gnu C Compiler (gcc) to compile.

我试图写一个简单的摄氏=>华氏转换器和我收到以下错误:

I'm trying to write a simple Celcius => Fahrenheit converter and I am getting the following error:

称为对象0不是一个函数

called object '0' is not a function

我的code是如下:

#include <stdio.h>

main()
{
    for(int i = 0; i < 300; i+20)
    {
        int celcius = (5/9)(i-32);
        printf("%d - %d \n", i, celcius);
    }
}

我这个编译:

gcc FahrenheitToCelcius.c -std=c99

有人能指出我在做什么错在这里?

Could somebody point what I'm doing wrong here?

感谢

推荐答案

在C(和我假设在其他语言太:))算术运算符是需要进行算术运算。结果
更改

In C (and I am assuming that in other languages too :)) an arithmetic operator is needed to perform an arithmetic operation.
Change

int celcius = (5/9)(i-32);

int celcius = (5/9)*(i-32);

这篇关于为什么我会得到一个“所谓的对象0不是一个函数错误”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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