We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

See attached file ...................


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 314

Attachments:

Replies to This Discussion

bahe in how form we submit this ......

run .cpp without the .txt file then the program won't run...we have to submit .cpp file only not .cpp+.txt

kia hum .tex file bhi upload kraan gay??????

thank u 4 this

( @ syed nashit. First we have to create a file through " c++ code"  and then Open file and read data from it and display it on the screen ) so no need to upload the .txt file.

read the Detailed Description:

Write a C++ program in which you have to: 

1. Create a text file “Electricity_Bill”.

2. Write following data in it:

3. Open file and read data from it and display it on the screen.

#include <fstream>

#include <iostream>
using namespace std;
int main()

{  char str[10];
  //Creates an instance of ofstream, and opens example.txt 

ofstream a_file ( "Electricity_Bill.txt" ); 

// Outputs to example.txt through a_file 

a_file"This text will now be inside of Electricity_Bill.txt"; 

// Close the file stream explicitly 

a_file.close(); 

ifstream inFile;

char inputFileName[]="Electricity_Bill.txt";

const int MAX_CHAR_TO_READ = 100;

char completeLineText[MAX_CHAR_TO_READ];
inFile.open(inputFileName);
if(!inFile)

{

cout "Invalid file name: " inputFileName endl;

exit(1);

 }
while(!inFile.eof())

{

inFile.getline(completeLineText,MAX_CHAR_TO_READ);

cout completeLineText endl;

}

inFile.close();

system("PAUSE");

}

hello friends i can create a text file through coding but unable to put the whole data in text file.please test this code and also help me how i put the full data into in

 

thanks dude!!!

 

zeeshan bhai yeh program tu sahi ban gia hai but data full enter nahi ho raha yehi just problem hai.ab file .text create b coding k through ho rahi hai aur read aur write b.just data ka problem hai.

any

1

plzzzzzzz.....

RSS

Looking For Something? Search Here

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.