Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Computer Science and Other Items
#51
Quote:Is it just me or is all the sample source written so that functions that require other functions go in later?

Thats because that haven't been explicity defined, this is true for any C compiler.
Code:
int main() {
  func();
}

void func() {
  /* Blah */
}
Is wrong, because func() hasn't been defined prior to being called, one solution is the following:
Code:
void func() {
  /* Blah */
}

int main() {
  func();
}
When func() is called, it has already been defined. A better solution is this:
Code:
void func();

int main() {
  func();
}

void func() {
  /* Blah */
}

Either of the last two can be compiled using a one-pass compiler and look up tables.
esus saves.... Passes to Moses, shoots, he scores!
Reply
#52
recursive calls...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)