error C2248: "std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'

Ich bin nicht in der Lage zu verstehen, dieser Fehler.Dieser Fehler ist nicht in der Klasse, ich bin Debuggen . (Ist es ?)
Der Fehler ist :

c:\program files\microsoft visual studio 10.0\vc\include\fstream(890): error    C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files\microsoft visual studio 10.0\vc\include\ios(176) : see     declaration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          This diagnostic occurred in the compiler generated   function 'std::basic_ifstream<_Elem,_Traits>::basic_ifstream(const std::basic_ifstream<_Elem,_Traits> &)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Was könnten die Gründe sein, die ich bin immer diese Fehlermeldung ? Der code ist zu lang, zu posten.
Der compiler, den ich verwende, ist Microsoft visual c++ 2010 express

EDIT:

    void HostelManager::guestMonitor() {
        system("cls");

        cout << "Name of the guest : "; //cin guest
        cin.ignore();
        getline( cin , guestName );

        cout << "\nWhom to meet : ";   //to whom the guest wants to meet
        cin.ignore();
        getline( cin , fullName ); 

        string pathGND = "d:/HostelManager/studentDetails/groundFloor/" + fullName + ".txt";
        string pathFST = "d:/HostelManager/studentDetails/firstFloor/" + fullName + ".txt";
        string pathSND = "d:/HostelManager/studentDetails/firstFloor/" + fullName + ".txt";
        ifstream checkStudentGND( pathGND );
        ifstream checkStudentFST( pathFST );
        ifstream checkStudentSND( pathSND );
        string x = "Floor";

        if( checkStudentGND ) {
            ifstream readRoom( pathGND );
            readRoom >> fullName >> fatherName >> permanentAddress >> postalAddress >> x >> roomNumberToBeAlloted_GND;
            int hisRoomNumber = roomNumberToBeAlloted_GND;
            readRoom.close();
            storeGuestData( hisRoomNumber , fullName );  //call to store guest data
        } else if( checkStudentFST ) {
            ifstream readRoom( checkStudentFST );
            readRoom >> fullName >> fatherName >> permanentAddress >> postalAddress >> x >> roomNumberToBeAlloted_FST;
            int hisRoomNumber = roomNumberToBeAlloted_FST;
            storeGuestData( hisRoomNumber , fullName );  //call to store guest data
        } else if( checkStudentSND ) {
            ifstream readRoom( checkStudentSND );
            readRoom >> fullName >> fatherName >> permanentAddress >> postalAddress >> x >> roomNumberToBeAlloted_SND;
            int hisRoomNumber = roomNumberToBeAlloted_SND;
            storeGuestData( hisRoomNumber , fullName );  //call to store guest data
        } else {
            string sorryMSG = "Sorry ! The student is not in this hostel"                  cout << sorryMSG << endl ;
        }
   }

Die aufgerufene Funktion:

    void HostelManager::storeGuestData( int hisRoomNumber , string hisName ) {
        cout << "\nVisitor's Address : ";  //cin visitor address
        string visitorAddress;
        getline( cin , visitorAddress );

        cout << "\nRelation with the student : ";   //cin relation with student
        string relation;
        getline( cin , relation );

        cout << "\nEnter Month";    //cin enter month
        short month;
        cin >> month;

        cout << "\nEnter Date";    //cin enter date
        short date;
        cin >> date;

        cout << "\nYou can meet " << hisName << " in room number " << hisRoomNumber << endl ;

        string visitorPath = "d:/HostelManager/GuestMonitor/" + fullName + ".txt" ;
        ofstream guestEntry( visitorPath );
        guestEntry << "Name of Visitor : " << guestName << endl ;
        guestEntry << "To meet : " << fullName << endl ;
        guestEntry << "Address of visitor : " << visitorAddress << endl ;
        guestEntry << "Relation with the student : " << relation << endl ;
        guestEntry << "Month : " << month << endl ;
        guestEntry << "Date : " << date << endl ; 
        guestEntry.close();
        cout << "\n\n\n\nData successfully inserted";
    }

Daten Mitglieder:

    private:
        string fullName;
        string fatherName;
        string permanentAddress;
        string postalAddress;
        int mobileNumbers[2][10];
        double percentageMarks;
        int roomNumber;
        int roomNumberToBeAlloted_GND ;
        int roomNumberToBeAlloted_FST ;
        int roomNumberToBeAlloted_SND ;
        string preferredFloor;
        string guestName;
        string studentFined;
        string complaintAgainst;
        string receiverOfEmail;
        string senderOfEmail;
        string subject;

    public:
        void guestMonitor();
        void storeGuestData( int hisRoomNumber , string hisName );
  • Konnte Sie zumindest poste den Teil des Codes, wo dieser Fehler Auftritt ?
  • -1 zu erwarten, dass uns in den Sinn-Lesen Sie den code. gonna entfernen -1 einmal ein minimales testcase oder zumindest der Fehler + andere relevante Abschnitte gebucht werden.
  • phresnel habe ich bearbeitet die post
  • Sie müssen das weglassen der Leerzeichen zwischen @ und dem Namen, um mich benachrichtigt. Abgesehen davon: Ihr code ist nicht formatiert, gut und schwer zu Lesen als nötig. Vielleicht verwenden Sie Ihre Redakteure auto-Einzug. Ich werde neutralisieren mein downvote sowieso.
InformationsquelleAutor saplingPro | 2011-07-12
Schreibe einen Kommentar