Hey i have a rather wierd question....
say i have a function that compares strings that looks like the following when used in code:
1st param is 1st string and 2nd is what the 1st is being compared to..... if they are the same then true else false....
now i have a group of strings i want to compare and i dont want to write like 7 of those if statmenets or keep repeating the function in that one if statements...
i was wondering if there is a way to squeeze together a bunch of strings in the 2nd param in order to compare it and if any of them are true do something else do something else.... example:
instead of
if tried #define groupA (CHARA, CHARB, etc...) but i get a runtime error
P.S. is there a way to increase the number of parameters based on programmers input without actually modifying the code to include like 50 of them with default values?
thanks
DK--
say i have a function that compares strings that looks like the following when used in code:
Code:
if ((StrComp (some char* here, another char* here)) [.......]
now i have a group of strings i want to compare and i dont want to write like 7 of those if statmenets or keep repeating the function in that one if statements...
i was wondering if there is a way to squeeze together a bunch of strings in the 2nd param in order to compare it and if any of them are true do something else do something else.... example:
Code:
if ((StrComp(CHARA, (CHARB OR CHARC OR CHARD OR etc...))
Code:
if (StrComp (CHARA, CHARB) || StrComp (CHARA, CHARC)) ... etc.
P.S. is there a way to increase the number of parameters based on programmers input without actually modifying the code to include like 50 of them with default values?
thanks
DK--
Comment