WELCOME TO MY BLOG BY SHABEEB.K

C,C++ PROGRAMMING: CREATE TEXT FILE.

Search This Blog

Thursday, 28 November 2013

CREATE TEXT FILE.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
void main()
{
char a[80];
cout<<"ENTER A STRING CHARACTER\n";
cin>>a;

FILE *fp; //fp set pointer to FILE.

fp=fopen("CPROGRAM.txt","a"); //syntax to create a text named "CPROGRAM.txt" file. 
fprintf(fp,"\n%s",a);     //syntax to write data to "CPROGRAM.txt" file that u entred  character.
fclose(fp);           //syntax to save this file.
cout<<"FILE ""CPROGRAM"" IS CREATED\n  To see this file  check your TC/BIN location or location programm where ur stored this programm.\n";
getch();
}


FILE LOCATION:

No comments:

Post a Comment