error: A label can only be part of a statement
I'm writing a brainfuck interpreter in C, and I'm having a little bit of trouble with the use of somethings I'm not used to. In brainfuck, a comma ( ,) is essentially getchar(). So I have the following code:

    //This is just ptr
    static char *ptr;

    // Here's the code causing error
    case ',':
       ptr*=getchar();
       break;

gcc throws `error: a label can only be part of a statement and a declaration is not a statement` at me when I try to compile this.

Any ideas? (Sorry about this, not so familiar with this error)
error: A label can only be part of a statement
===

I'm writing a brainfuck interpreter in C, and I'm having a little bit of trouble with the use of somethings I'm not used to. In brainfuck, a comma ( ,) is essentially getchar(). So I have the following code:

    //This is just ptr
    static char *ptr;

    // Here's the code causing error
    case ',':
       ptr*=getchar();
       break;

gcc throws `error: a label can only be part of a statement and a declaration is not a statement` at me when I try to compile this.

Any ideas? (Sorry about this, not so familiar with this error)