<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4565810339254354988</id><updated>2011-07-31T00:58:00.636-07:00</updated><title type='text'>Diana's blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dcucereavii.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4565810339254354988/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dcucereavii.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Diana</name><uri>http://www.blogger.com/profile/01896342509706265633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4565810339254354988.post-969111166447885352</id><published>2009-11-16T16:03:00.000-08:00</published><updated>2009-11-16T16:40:17.584-08:00</updated><title type='text'>Todo</title><content type='html'>The following code prints the contents of the file containing Students' records backwards (today's class todo):&lt;br /&gt;&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;#include &lt;fstream&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;#include &lt;string.h&gt;&lt;br /&gt;&lt;br /&gt;class Student{&lt;br /&gt; char _name[51];&lt;br /&gt; int _noOfSubjects;&lt;br /&gt; float _gpa;&lt;br /&gt;public:&lt;br /&gt; Student(const char name[]="", int noOfSub=0, float gpa=0.0){&lt;br /&gt;   strcpy(_name, name);&lt;br /&gt;   _noOfSubjects = noOfSub;&lt;br /&gt;   _gpa=gpa;&lt;br /&gt; }&lt;br /&gt; ostream&amp;amp; print(ostream&amp;amp; os)const{&lt;br /&gt;  return os&lt;&lt; "name: "&lt;&lt; _name&lt;&lt; ",Subjects: "&lt;&lt; _noOfSubjects&lt;&lt; ",Gpa: "&lt;&lt; _gpa;&lt;br /&gt; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;ostream&amp;amp; operator&lt;&lt; (ostream&amp;amp; os,const Student&amp;amp; S){&lt;br /&gt; return S.print(os);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(){&lt;br /&gt; Student S;&lt;br /&gt; fstream fin("std.bin",ios::in| ios::ate | ios::binary);&lt;br /&gt; int cnt = (fin.tellg()/sizeof(Student));&lt;br /&gt; for(int i=0; i&lt; cnt; i++){&lt;br /&gt;     fin.seekg((-sizeof(Student))*(i+1), ios::end);&lt;br /&gt;     fin.read((char*)&amp;amp;S, sizeof(Student));&lt;br /&gt;     cout&lt;&lt; S &lt;&lt; endl;&lt;br /&gt; }&lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Input File:&lt;br /&gt;name: John Doe,Subjects: 4,Gpa: 3.5&lt;br /&gt;name: Fred Soley,Subjects: 3,Gpa: 2.5&lt;br /&gt;name: Fardood Solimon,Subjects: 2,Gpa: 3.5&lt;br /&gt;name: Joe Black,Subjects: 5,Gpa: 3&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;name: Joe Black,Subjects: 5,Gpa: 3&lt;br /&gt;name: Fardood Solimon,Subjects: 2,Gpa: 3.5&lt;br /&gt;name: Fred Soley,Subjects: 3,Gpa: 2.5&lt;br /&gt;name: John Doe,Subjects: 4,Gpa: 3.5&lt;/string.h&gt;&lt;/fstream&gt;&lt;/iostream&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4565810339254354988-969111166447885352?l=dcucereavii.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcucereavii.blogspot.com/feeds/969111166447885352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcucereavii.blogspot.com/2009/11/following-code-prints-contents-of-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4565810339254354988/posts/default/969111166447885352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4565810339254354988/posts/default/969111166447885352'/><link rel='alternate' type='text/html' href='http://dcucereavii.blogspot.com/2009/11/following-code-prints-contents-of-file.html' title='Todo'/><author><name>Diana</name><uri>http://www.blogger.com/profile/01896342509706265633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4565810339254354988.post-1030433997191197961</id><published>2009-09-15T08:11:00.001-07:00</published><updated>2009-09-15T08:11:43.906-07:00</updated><title type='text'>Test Message</title><content type='html'>test&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4565810339254354988-1030433997191197961?l=dcucereavii.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcucereavii.blogspot.com/feeds/1030433997191197961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcucereavii.blogspot.com/2009/09/test-message.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4565810339254354988/posts/default/1030433997191197961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4565810339254354988/posts/default/1030433997191197961'/><link rel='alternate' type='text/html' href='http://dcucereavii.blogspot.com/2009/09/test-message.html' title='Test Message'/><author><name>Diana</name><uri>http://www.blogger.com/profile/01896342509706265633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
