Why am I getting the error: identifier 'last_code' cannot have a type qualifier?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prathamnitika
    New Member
    • Jan 2013
    • 1

    #1

    Why am I getting the error: identifier 'last_code' cannot have a type qualifier?

    Code:
    int food :: last_code(void)
    {
       fstream file;
       file.open("FOOD.DAT", ios::in);
       file.seekg(0, ios::beg);
       int t=0;
       while(file.read((char *) this, sizeof(food)))
       t=itemcode;
       file.close();
       return t;
    }
    Last edited by Rabbit; Jan 31 '13, 05:04 PM. Reason: Please use code tags when posting code.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    The most likely answer is that last_code is not declared in food class definition as a member function. We would need to see the definition of class food to help much further.

    Comment

    Working...