OOCP4-6

//BCA Support //www.bcasupport.xyz #include <iostream.h> #include <conio.h> #include <fstream.h> int main() { clrscr(); char a='>',text1[]=" Hello "; int i=100; ofstream fout("file.txt"); fout.write(&a,sizeof(a)); fout.write((char *)&i,sizeof(i)); fout.write(&text1[0],sizeof(text1)); fout.close(); char b,text2[10]; int j; ifstream fin("file.txt"); fin.read(&b,sizeof(b)); fin.read((char *)&j,sizeof(j)); fin.read(&text2[0],sizeof(text2)); cout<<b<<text2<<j; fin.close(); getch(); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.