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


Messages In This Thread
Computer Science and Other Items - by dadsherm - 02-09-2004, 10:45 PM
Computer Science and Other Items - by stevie - 02-09-2004, 10:53 PM
Computer Science and Other Items - by Agamemnus - 02-10-2004, 05:23 AM
Thanks Everyone - by dadsherm - 02-10-2004, 05:48 PM
Computer Science and Other Items - by Agamemnus - 02-11-2004, 05:27 AM
Computer Science and Other Items - by na_th_an - 02-11-2004, 07:24 AM
Computer Science and Other Items - by Zack - 02-11-2004, 07:27 AM
Computer Science and Other Items - by na_th_an - 02-11-2004, 07:46 AM
Computer Science and Other Items - by Zack - 02-11-2004, 07:49 AM
Computer Science and Other Items - by Agamemnus - 02-11-2004, 07:52 AM
Computer Science and Other Items - by Zack - 02-11-2004, 07:53 AM
Computer Science and Other Items - by na_th_an - 02-11-2004, 07:58 AM
Computer Science and Other Items - by Agamemnus - 02-11-2004, 08:52 AM
Computer Science and Other Items - by relsoft - 02-11-2004, 11:32 AM
Computer Science and Other Items - by Agamemnus - 02-11-2004, 08:35 PM
Your Choice. - by dadsherm - 02-11-2004, 09:50 PM
Computer Science and Other Items - by Agamemnus - 02-11-2004, 10:01 PM
It's Your Choice - by dadsherm - 02-11-2004, 10:55 PM
Computer Science and Other Items - by na_th_an - 02-11-2004, 10:56 PM
Computer Science and Other Items - by Zack - 02-12-2004, 03:28 AM
Computer Science and Other Items - by oracle - 02-12-2004, 03:52 AM
Computer Science and Other Items - by na_th_an - 02-12-2004, 05:11 AM
Computer Science and Other Items - by Zack - 02-12-2004, 05:13 AM
Computer Science and Other Items - by na_th_an - 02-12-2004, 05:22 AM
Computer Science and Other Items - by Zack - 02-12-2004, 05:24 AM
Computer Science and Other Items - by na_th_an - 02-12-2004, 05:39 AM
What did I start? - by dadsherm - 02-12-2004, 06:06 AM
Computer Science and Other Items - by Zack - 02-12-2004, 07:11 AM
Tutorial on expression parsing. - by Agamemnus - 02-12-2004, 07:44 AM
Computer Science and Other Items - by Zack - 02-12-2004, 07:47 AM
Computer Science and Other Items - by Zack - 02-12-2004, 07:58 AM
Computer Science and Other Items - by Zack - 02-12-2004, 08:48 AM
Computer Science and Other Items - by Zack - 02-12-2004, 09:12 AM
Computer Science and Other Items - by Agamemnus - 02-13-2004, 12:06 AM
Computer Science and Other Items - by Agamemnus - 02-13-2004, 06:51 AM
Computer Science and Other Items - by LooseCaboose - 02-13-2004, 07:27 AM
Computer Science and Other Items - by Agamemnus - 02-13-2004, 07:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)