<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>File operations | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/file-operations/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 13 Mar 2010 18:14:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ program to copy one file to anothere file</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-copy-one-file-to-anothere-file/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-copy-one-file-to-anothere-file/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 18:14:35 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[File operations]]></category>
		<category><![CDATA[c++ files]]></category>
		<category><![CDATA[lower case]]></category>
		<category><![CDATA[upper case]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1073</guid>

					<description><![CDATA[<p>AIM A program to copy one file to another file and convert the lower case characters to upper case characters. ALGORITHM 1) Start the process 2) Create the input file and out put file. 3) Get the input file name to fname1. 4) Get the output file name to fname2. 5) Open the infile(fanme1) 6)</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-copy-one-file-to-anothere-file/">C++ program to copy one file to anothere file</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM</strong><br />
	A program to copy one file to another file and convert the lower case characters to upper case characters.</p>
<p><strong>ALGORITHM </strong></p>
<p>1)	Start the process<br />
2)	Create the input file and out put file.<br />
3)	Get the input file name to fname1.<br />
4)	Get the output file name to fname2.<br />
5)	Open the infile(fanme1)<br />
6)	Check if infile.fail()<br />
a)	True:<br />
i)	Execute error conversion<br />
ii)	exit<br />
7)	open the outfile(fanme2)<br />
8)	check if outfile.fail()<br />
a)	repeat step(6:a)<br />
9)	check while infile.eof()<br />
a)	True:<br />
i)	 Ch?(char)infile.get()<br />
10)	Close both files<br />
11)	Stop the process.</p>
<p><strong>PROGRAM :</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdlib.h>
#include<ctype.h>
#include<fstream.h>

void main( )
{
	ofstream outfile;
	ifstream  infile;
	char fname1[10],fname2[20];
	char ch,uch;
	clrscr( );
	cout<<"Enter a file name to be copied ";
	cin>> fname1;
	cout<<"Enter new file name";
	cin>>fname2;
	infile.open(fname1);

if( infile.fail( ) )
	{
		cerr<< " No such a file Exit";
		getch();
		exit(1);
	}
	outfile.open( fname2);
		if(outfile.fail( ))
		{
			cerr<<"Unable to create a file";
			getch();
			exit(1);
		}
	while( !infile.eof( ) )
	{
		ch = (char) infile.get( );
		uch = toupper(ch);
		outfile.put(uch);
	}
	infile.close( );
	outfile.close( );
	getch( );
}
</pre>
<p><strong>OUTPUT:</strong></p>
<p>	Enter a file name to be copied.<br />
		C:\text1.txt<br />
	Enter new file name<br />
		D:\new.txt</p>
<p>Input file<br />
		Asbcdefghijklmnopqrstuvwxyz<br />
Output file<br />
		ASBCDEFGHIJKLMNOPQRSTUVWXYZ</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-copy-one-file-to-anothere-file/">C++ program to copy one file to anothere file</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-copy-one-file-to-anothere-file/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>C++ class program to illestrate File operations</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 18:08:00 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c++ class]]></category>
		<category><![CDATA[File operations]]></category>
		<category><![CDATA[file open]]></category>
		<category><![CDATA[file write]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1070</guid>

					<description><![CDATA[<p>AIM Write a program to illustrate the write() member function which are usually used for transfer of data blocks to the file. ALGORITHM 1. Start the process 2. Invoke the class a. Create two inline member functions .ie, getdata() and dispdata() i. getdata() for input ii. dispdata() for display 3. Open the file in fstream</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/">C++ class program to illestrate File operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM</strong><br />
	Write a program to illustrate the write() member function which are usually used for transfer of data blocks to the file.</p>
<p><strong>ALGORITHM</strong></p>
<p>1.	Start the process<br />
2.	Invoke the class<br />
a.	Create two inline member functions .ie, getdata() and dispdata()<br />
i.	getdata() for input<br />
ii.	dispdata() for display<br />
3.	Open the file in fstream mode<br />
4.	Write the data in to the file<br />
5.	Slose the file<br />
6.	Stop the process</p>
<p><strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
class student
{
private:
int rno;
char name[10];
float fees;
public:
void getdata()
{
cout<<"roll number";
cin>>rno;
cout<<endl;
cout<<"enter name:";
cin>>name;
cout<<endl<<"enter fees:";
cin>>fees;
}
void dispdata()
{
cout<<"Roll number"<<rno<<endl;
cout<<"Name"<<name<<endl;
cout<<"Fees"<<fees;
}
};

void main()
{
student s1;
clrscr();
ofstream stdfile("c:\\std.txt");
//fstream stdfile;
//stdfile.open("c:\\std.txt",ios::out|ios::in);  //open file for output
char wish;
//writing to the file
do
{
s1.getdata();
stdfile.write((char*)&#038;s1,sizeof(student));
cout<<"continue ? y/n";
cin>>wish;
}
while(wish=='y'||wish=='Y');
stdfile.close();   //close the file

getch();
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>Roll number  121<br />
Enter name  Jacob<br />
Enter fees   10000</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/">C++ class program to illestrate File operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-class-program-to-illestrate-file-operations/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
