I know this type of question has been answered before, but I have my own solution and I would like to solve the bug in it. I'm not worried about in quote comments, I know this code wont handle them. The problem is that the initial `/` starting off the `/* … */` comment gets printed to the file when it should not be.

```
int cleanFile( char *fileName ){

FILE *fp;
fp = fopen(fileName, "r");
int inComment = 0;
char current, next;

//will return exit exicution if the file does not exist
if(fp == NULL){
    printf("%s", "File was not found.\nFile is expected to be in src directory.");
    return 0;
}
//creat a new file for the clean input
FILE *cf;
cf = fopen( "cleaninput.txt", "w" );

current = fgetc(fp);

while(current != EOF){

    if( inComment == 0 ){

        if(current == '/')
        {
            next = fgetc(fp);

                //look ahead and see if this is the start of a comment
                if(next == '*')
                {

                    inComment = 1;
                    current = next;   //CODE JUMPS FROM HERE 

                }else{

                    fputc(current, cf);
                    current = next;

                }
        }else{
            fputc(current, cf);
            current = fgetc(fp); // AND LANDS HERE
        }

    //if an exit sequence is found set in comment to false
    }else{
        if(current == '*')
        {
            next = fgetc(fp);
            if(next == '/')
            {
                inComment = 0;
                current = next;
            }
        }else{
            current = fgetc(fp);
        }
    }
}//end while

fclose(fp);
fclose(cf);

return 1;
}

```