2013-08-01 35 views
0

我一直有麻烦在我的代码中调用我的函数。自定义函数不被调用

#include <iostream> 
#include <cmath> 
#include <cstdlib> 

void bunky(int); 

int main() 
{ 
    using namespace std; 

    bucky(20); 

    cin.get(); 
    return 0; 
} 

void bucky(int x) 
{ 
    using namespace std; 
    cout << "My favorite number is " << x << endl; 
} 

当我尝试编译它时说,“[错误]'bucky'没有在此范围内声明”任何和所有的帮助将是伟大的。

回答

1

函数的声明是错误的变化

void bunky(int); 

void bucky(int);