im working on code so that you will be able to input code w/comments and this function will take them out after i compile i get a const char to int error, i think i know what this error is, im trying to convert a char into an int, i know c fairly well and this is my first jump to .cpp...i was just looking for some input on how to get this right. Thanks
Code:void FilterComments (const char *in, char *out) { const char *inPTR; char *outPTR; inPTR = in; outPTR = out; while((inPTR) != '\0') /* while inPTR != null*/ { if ((inPTR) == '/' || (inPTR) == '\') { inPTR++; if ((inPTR) == '/' || (inPTR)== '*') { outPTR = ' '; outPTR++; } else { if(inPTR == '"') { do{ inPTR++; } while((inPTR) != '"'); } else { outPTR = inPTR; inPTR++; outPTR++; } } } else { if(inPTR == '"') { do{ inPTR++; } while((inPTR) != '"'); } else { outPTR = inPTR; inPTR++; outPTR++; } } } }