am******@gmail.com writes:
I am compileing a project and I get multiple errors in my switch
statements "illegal case"
Here is some code that looks OK to me.I get an error for eaxh case
These are all ansi c using VS 2005 compiler.
for (i= 1; i < (argc - 1); i++)
{
switch (argv[i][0])
{
case '-':
switch (argv[i][1])
{
case 'h':
case 'H':
showHelp(); /* Show help screen and */
return(1); /* exit program. */
break;
case 'c':
case 'C':
memcpy(comPortName, &argv[i][2], strlen(argv[i])-2);
break;
case 'p':
case 'P':
passwdFile= &argv[i][2];
break;
case 'w': case 'W':
toDo.Wait= 1; /* Do wait for <Enterat the end! */
break;
case '1':
toDo.OnePass= 1;
break;
case 'f':
case 'F':
This is a code fragment. It cannot be compiled by itself, and it
refers to several things that are not declared within the fragment (i,
argv, showHelp, etc.). We can't guess what might be wrong with the
surrounding code.
If you'll show us a complete program that exhibits the problem, we can
probably help. Trim your program down to a reasonable size before
posting it.
And *please* indent properly; with everything left-justified like
this, it's very difficult to read. (If you used tabs for indentation,
please expand them to spaces before posting; some news software
doesn't like tab characters.)
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.