Quote:
Originally Posted by BW-userx
Code:
switch (opts.set_random_color)
{printf("IN SWITCH in set_random_colors : opts.set_random_color %d \n",opts.set_random_color);
case 1: ...
break;
case 2 ... MAX_SHOW_COLORS:
break;
default:
break;
}
|
All else aside, C switch does not work that way. There are at least two obvious errors here, please see the language reference for the use of C switch. Please see the
C/C++ Tutorials sticky link at top of the Programming forum for C/C++ language resources.
Please end your pattern of posting before doing basic research, and please do not treat the LQ programming forum as your development scratchpad for transient coding ideas. Make your design choices, perform your basic troubleshooting and research before posting, then if you still need help post a minimal example of the specific problem you are having, without all the irrelevant application specific code.
These hasty and ill-considered threads will continue to show up in search results for years to come, and lead those lookiing for help to dead ends with no useful information. This is not healthy for LQ, not helpful to others and not beneficial to yourself.
Please take this as a warning that this behavior must stop, now. Review the
LQ Rules,
Site FAQ and other resources available from the sidebar if you have questions.
This thread is now closed.