Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to declare a function identifier

If i have a sample code like this:

void 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?

like image 942
Shadi Avatar asked Feb 14 '26 02:02

Shadi


2 Answers

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();
}
like image 183
Bill Avatar answered Feb 16 '26 15:02

Bill


void func_2 ();

void func_1 ()
{
 ...
}

void func_2 ()
{
 ...
}
like image 28
judda Avatar answered Feb 16 '26 17:02

judda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!