I want to use a function to call another function, like this:
Code:
It always gives me half a dozen of errors and warnings. I tried using an external function Ping_Pong (int x, int y); and declared the above functions inside it and for Pong (3), I wrote Ping_Pong(0,3), but it still doesn't work. It always says "Undefined reference to function [either Ping or Pong]
How do I mak this work?
Code:
void Ping(int x)
{
switch(x)
{
case 1:
case 2:
case 3: while (x--)
printf("\n%d",--x);
break;
case 25: pong (3);
break;
default: printf("\nSome text");
pong(123);
}
}
void Pong (int y)
{
switch (x)
{ case 1:
case 2: Ping (x);
case 3: y=5;
y++;
return;
default: printf("\nHello");
return;
}
}
main()
{
Pong (3);
Ping (-4);
}
It always gives me half a dozen of errors and warnings. I tried using an external function Ping_Pong (int x, int y); and declared the above functions inside it and for Pong (3), I wrote Ping_Pong(0,3), but it still doesn't work. It always says "Undefined reference to function [either Ping or Pong]
How do I mak this work?