Asalamo Alikpm w rahmt Allah w baracato, hello sonu , look the if statment and switch doesnot take any space in memory as there are set of flags in processor .this flags are used in special cases such as greater than , less than ,equality and any other condition like greater than or equal ........etc. but variables and constants that are used in conditions takes spaces in memory. secondly: the speed of execution for IF and Switch depends on the microprocessor that checks the condition and execute it and the condition itself but if we compare the if and switch on the speed and use the same conditions and cases the two will be equal as i said it depends on microprocessor ( set of flags) and the condition . ex boolean x,y; if(x) y=true; else y=false switch (x) case "true": y=true case "false":y=false
Note:this example is general and not belong to a specific language i used it to explain my point of view no else thanks, Eng A.Mahmoud --- On Tue, 8/24/10, Sonu <[email protected]> wrote: From: Sonu <[email protected]> Subject: [c-prog] IF and Switch statement in c language To: [email protected] Date: Tuesday, August 24, 2010, 11:00 PM Hello, any one can tell me, Is IF or switch statement take space in memory or not? and which one faster...... [Non-text portions of this message have been removed]
