error C2451: conditional expression of type 'class fstream' is illegal Ambigu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rashmi Gosavi
    New Member
    • Jul 2010
    • 1

    error C2451: conditional expression of type 'class fstream' is illegal Ambigu

    case 2 : //Display All Records
    file.seekg(0,io s::beg);
    cout<<"\n\nReco rds in Phone Book\n";
    while(file){
    file.read((char *) &rec, sizeof(rec));
    if(!file.eof())
    rec.showdata();
    }
    file.clear();
    getch();
    break;
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This compiles for me. Your error may vbe outside this code snippet.

    Comment

    Working...