char buf[132] = {'\0'}; string sFileName = argv[2]; FILE * fp = fopen(sFileName.c_str(),"r+t"); if(fp) { while(!feof(fp)) { fread(buf,sizeof(char),128,fp); sInfixExp = sInfixExp + buf; memset(buf,'\0',132); } fclose(fp); }