negative constant converted to unsigned type error in c++ by using visual studio how to solve
<p>my C++ program is running well on dev c++ compiler. But now I want to run it win32 console on visual studio 2013 but I am getting an error: <strong>negative constant converted to unsigned type</strong> </p>

<p>Could you please tell me how to solve it?</p>

<pre><code>void modifystudent(int id) 
{   
    fstream file;   
    file.open("users11.txt",ios::in | ios::out);
    student obj;    
    system("cls");
    while (file.read((char*)&amp;obj, sizeof(obj)))     
    {       
        if (obj.givid() ==id)       
        {           
            cout &lt;&lt; "\nPlease enter new details of student";
            obj.getrecord();   //// error is here negative constant converted to unsigned type          
            int pos = -1 * sizeof(obj);
            file.seekp(pos, ios::cur);
            file.write((char*)&amp;obj, sizeof(obj));           
            cout &lt;&lt; endl &lt;&lt; " Record is Modified.." &lt;&lt; endl;        
        }   
    }

    file.close();   
   // free(obj);
 }
</code></pre>