Note that there are some explanatory texts on larger screens.

plurals
  1. POerror C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
    primarykey
    data
    text
    <p>I am unable to understand this error.This error is not in the class that i am debugging . <em>(Is it ?)</em> The error is : </p> <pre><code>c:\program files\microsoft visual studio 10.0\vc\include\fstream(890): error C2248: 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios' : cannot access private member declared in class 'std::basic_ios&lt;_Elem,_Traits&gt;' 1&gt; with 1&gt; [ 1&gt; _Elem=char, 1&gt; _Traits=std::char_traits&lt;char&gt; 1&gt; ] 1&gt; c:\program files\microsoft visual studio 10.0\vc\include\ios(176) : see declaration of 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios' 1&gt; with 1&gt; [ 1&gt; _Elem=char, 1&gt; _Traits=std::char_traits&lt;char&gt; 1&gt; ] 1&gt; This diagnostic occurred in the compiler generated function 'std::basic_ifstream&lt;_Elem,_Traits&gt;::basic_ifstream(const std::basic_ifstream&lt;_Elem,_Traits&gt; &amp;)' 1&gt; with 1&gt; [ 1&gt; _Elem=char, 1&gt; _Traits=std::char_traits&lt;char&gt; 1&gt; ] ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== </code></pre> <p><em>What could be the reasons i am getting this error ? The code is too lengthy to post.</em> The compiler that i am using is <strong>Microsoft visual c++ 2010 express</strong></p> <p>EDIT:</p> <pre><code> void HostelManager::guestMonitor() { system("cls"); cout &lt;&lt; "Name of the guest : "; // cin guest cin.ignore(); getline( cin , guestName ); cout &lt;&lt; "\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 &gt;&gt; fullName &gt;&gt; fatherName &gt;&gt; permanentAddress &gt;&gt; postalAddress &gt;&gt; x &gt;&gt; roomNumberToBeAlloted_GND; int hisRoomNumber = roomNumberToBeAlloted_GND; readRoom.close(); storeGuestData( hisRoomNumber , fullName ); // call to store guest data } else if( checkStudentFST ) { ifstream readRoom( checkStudentFST ); readRoom &gt;&gt; fullName &gt;&gt; fatherName &gt;&gt; permanentAddress &gt;&gt; postalAddress &gt;&gt; x &gt;&gt; roomNumberToBeAlloted_FST; int hisRoomNumber = roomNumberToBeAlloted_FST; storeGuestData( hisRoomNumber , fullName ); // call to store guest data } else if( checkStudentSND ) { ifstream readRoom( checkStudentSND ); readRoom &gt;&gt; fullName &gt;&gt; fatherName &gt;&gt; permanentAddress &gt;&gt; postalAddress &gt;&gt; x &gt;&gt; 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 &lt;&lt; sorryMSG &lt;&lt; endl ; } } </code></pre> <p>The called function:</p> <pre><code> void HostelManager::storeGuestData( int hisRoomNumber , string hisName ) { cout &lt;&lt; "\nVisitor's Address : "; // cin visitor address string visitorAddress; getline( cin , visitorAddress ); cout &lt;&lt; "\nRelation with the student : "; // cin relation with student string relation; getline( cin , relation ); cout &lt;&lt; "\nEnter Month"; // cin enter month short month; cin &gt;&gt; month; cout &lt;&lt; "\nEnter Date"; // cin enter date short date; cin &gt;&gt; date; cout &lt;&lt; "\nYou can meet " &lt;&lt; hisName &lt;&lt; " in room number " &lt;&lt; hisRoomNumber &lt;&lt; endl ; string visitorPath = "d:/HostelManager/GuestMonitor/" + fullName + ".txt" ; ofstream guestEntry( visitorPath ); guestEntry &lt;&lt; "Name of Visitor : " &lt;&lt; guestName &lt;&lt; endl ; guestEntry &lt;&lt; "To meet : " &lt;&lt; fullName &lt;&lt; endl ; guestEntry &lt;&lt; "Address of visitor : " &lt;&lt; visitorAddress &lt;&lt; endl ; guestEntry &lt;&lt; "Relation with the student : " &lt;&lt; relation &lt;&lt; endl ; guestEntry &lt;&lt; "Month : " &lt;&lt; month &lt;&lt; endl ; guestEntry &lt;&lt; "Date : " &lt;&lt; date &lt;&lt; endl ; guestEntry.close(); cout &lt;&lt; "\n\n\n\nData successfully inserted"; } </code></pre> <p>Data Members:</p> <pre><code> 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 ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload