开发者

How to declare a function identifier

开发者 https://www.devze.com 2023-03-12 08:27 出处:网络
If i have a sample code like this: 开发者_如何学Pythonvoid func_1 { ....... func_2; } func_2{ .......

If i have a sample code like this:

开发者_如何学Pythonvoid func_1 {
.......
func_2;
}
func_2{
.......
}

I need to declare a function identifier for func_2 so that the code could run how do i do that?


If func_2 won't call func_1, then you can just reorder them:

void func_2()
{
}

void func_1()
{
  // ...
  func_2();
}

If they both call each other, then you can declare like so:

void func2();
void func1()
{
  // ...
  func2();
}

void func2()
{
  // ...
  func1();
}


void func_2 ();

void func_1 ()
{
 ...
}

void func_2 ()
{
 ...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消