I'm confused!
lots of ways.... if statements, switches, function calls, gotos. I think you need to read a few tutorials especially on control statements and functions.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Using functions, iterations, selections and, in rare cases, goto.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
This is an example of overkill with gotos:
Code:#include <iostream> char name[256]; int main( void ) { goto b; f: return 0; e: std::cout<<std::endl; goto f; d: std::cout<<name; goto e; c: std::cout<<"Hello "; goto d; b: std::cin>>name; goto c; }
Last edited by XSquared; 03-16-2003 at 12:30 PM.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie