Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUsing WMI to get hardware information Pin
Anthony Mushrow12-Jun-09 4:49
professionalAnthony Mushrow12-Jun-09 4:49 
QuestionRe: Using WMI to get hardware information Pin
Randor 12-Jun-09 6:23
professional Randor 12-Jun-09 6:23 
AnswerRe: Using WMI to get hardware information Pin
Anthony Mushrow12-Jun-09 7:47
professionalAnthony Mushrow12-Jun-09 7:47 
GeneralRe: Using WMI to get hardware information Pin
Randor 12-Jun-09 8:36
professional Randor 12-Jun-09 8:36 
GeneralRe: Using WMI to get hardware information Pin
Anthony Mushrow15-Jun-09 0:50
professionalAnthony Mushrow15-Jun-09 0:50 
AnswerRe: Using WMI to get hardware information Pin
Stuart Dootson12-Jun-09 13:00
professionalStuart Dootson12-Jun-09 13:00 
GeneralRe: Using WMI to get hardware information Pin
Anthony Mushrow15-Jun-09 0:46
professionalAnthony Mushrow15-Jun-09 0:46 
QuestionHow to avoid if else... Pin
vikasvds12-Jun-09 3:40
vikasvds12-Jun-09 3:40 
Hello,

previously i have posted in wrong forum.
Problem is - User can input any number, program need to take decision based on inputs.

Let suppose input is stored in variable n;
based on value of n some function will be called.
program logic can be -

if(n > 1 && n < 10 )
callfun1();
if(n > 11 && n < 20 )
callfun2();
if(n > 25 && n < 30 )
callfun3();
if(n > 33 && n < 38 )
callfun4();
if(n > 1 && n < 10 )
callfun5();
.
.
.
and so on
if(n > minlimit && n < maxlimit )
callfunX();

Is there any easy way to avoid if else chain to do similar work.
Or is there any way to change the limits in if condition at some central place something using #define.

Please provide your inputs/help to help me finding other ways to optimize programming.

Thank
Vikas

vicky

AnswerRe: How to avoid if else... Pin
harold aptroot12-Jun-09 4:05
harold aptroot12-Jun-09 4:05 
AnswerRe: How to avoid if else... Pin
KarstenK12-Jun-09 4:21
mveKarstenK12-Jun-09 4:21 
AnswerRepost Pin
led mike12-Jun-09 4:23
led mike12-Jun-09 4:23 
GeneralRe: Repost Pin
vikasvds14-Jun-09 21:48
vikasvds14-Jun-09 21:48 
GeneralRe: Repost Pin
led mike15-Jun-09 5:10
led mike15-Jun-09 5:10 
AnswerRe: How to avoid if else... Pin
molesworth12-Jun-09 4:30
molesworth12-Jun-09 4:30 
GeneralRe: How to avoid if else... Pin
led mike12-Jun-09 4:35
led mike12-Jun-09 4:35 
GeneralRe: How to avoid if else... Pin
molesworth12-Jun-09 6:19
molesworth12-Jun-09 6:19 
JokeRe: How to avoid if else... Pin
CPallini12-Jun-09 6:42
mveCPallini12-Jun-09 6:42 
GeneralRe: How to avoid if else... Pin
led mike12-Jun-09 8:23
led mike12-Jun-09 8:23 
GeneralRe: How to avoid if else... Pin
CPallini12-Jun-09 22:39
mveCPallini12-Jun-09 22:39 
GeneralRe: How to avoid if else... Pin
led mike15-Jun-09 5:08
led mike15-Jun-09 5:08 
GeneralRe: How to avoid if else... Pin
CPallini15-Jun-09 8:39
mveCPallini15-Jun-09 8:39 
GeneralRe: How to avoid if else... Pin
Lutosław12-Jun-09 8:31
Lutosław12-Jun-09 8:31 
QuestionRe: How to avoid if else... Pin
CPallini12-Jun-09 5:46
mveCPallini12-Jun-09 5:46 
AnswerRe: How to avoid if else... Pin
vikasvds15-Jun-09 2:32
vikasvds15-Jun-09 2:32 
JokeRe: How to avoid if else... Pin
CPallini15-Jun-09 2:59
mveCPallini15-Jun-09 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.