weird error..., I have no idea about this one...
Code:
FILE *f = fopen(filename, "r");
while(fgetc(f)<=0x20);
while(fgetc(f)!=0x0A);
int rows = 0;
int collumns = 0;
int companies = 0;
char current = 0x00;
char old = 0x00;
string currentcomp = "";
string lastcomp = "";
bool checkcomp = true;
while(current!=EOF) {
current = fgetc(f);
if(checkcomp) {
if((current==0x09) || (current==0x0A)) {
checkcomp=false;
if(currentcomp!=lastcomp) {
collumns++;
lastcomp=currentcomp;
}
currentcomp="";
rows++;
}
else {
currentcomp.append((char*)¤t);
}
}
if(current==0x0A) {
checkcomp=true;
}
}
That is my code... The weird thing is, I want to do a ++ on companies instead of collumns in my code, but if I use the int companies I get wrong result, renaming the var doesn't work, the only thing that works that I've figured out is to use the collumns var... I don't get this, please help...