Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I'm not sure what 'void' has to do with it. All it does it tell the compiler the function after it does not return a value.
When you say 'combine two programs' do you mean two functions, within the same program or functions in a different '.C' programs?
In either situation, the switch command takes a parameter which you use to decide which exit from the statement you intend to take. Within the switch command you have either 'case' or 'default' statements. There should only be one 'default', it's the exit taken if all the 'case' checks fail. Each case has a condition which if true, makes the following code execute, if false, the program looks for the next 'case' or 'default' statement to check instead. You can run any code within a case statement, including calls to other functions.
Basically, a switch/case structure works the same as several "if (something is true) do ThisFunction() ;" statements, the difference is that the 'case' value must be a constant and that you can use 'default' as a catch-all if all the previous 'case' values failed to match. For example:
switch (MyValue)
{
case 1: FunctionMyValueWas1(...) ;
case 2: FunctionMyValueWas2(...) ;
case 3: FunctionMyValueWas3(...) ;
default: FunctionMyValueWasSomethingElse(...) ;
}
As in all 'C' functions, you can group several statements together between { and } so more than one instruction can execute per case match.
It is also common to see 'break' statements inside 'case' sections to skip the remaining checks and go straight to the end of the switch function.
to excel at the highest level, you have to excel at the basics first.
in your case, if you cannot express yourself clearly, I would suggest that you stop whatever you are doing and take some basic classes in composition and comprehension.
---------- Post added at 10:02 ---------- Previous post was at 10:00 ----------
this is the program of clock and i don't know how to start and insert the program of stopwatch,..can you please help me for some part of the programs...please please...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.