We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

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

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 266

.

+ 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)

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

Latest Activity

maria ali joined + M.Tariq Malik's group
2 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group EDU302 Human Development and Learning
8 minutes ago
+!!! Annie !!!+ liked №Oř's group Novels and Famous e books
8 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group CS204 Cyber Law
8 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group EDU433 Professionalism in Teaching
8 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group EDU654 Addressing problems of learning through technology and pedagogy
8 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group EDU630 Research Project - Education
8 minutes ago
+!!! Annie !!!+ liked + M.Tariq Malik's group TPT620 Teaching Practice (Long Term)
8 minutes ago
Ahad Kharal replied to + M.Tariq Malik's discussion CS625 Professional Practices Assignment No 01 Fall 2019 Solution & Discussion in the group CS625 Professional Practices
19 minutes ago
Ahad Kharal joined + M.Tariq Malik's group
19 minutes ago
DANI added a discussion to the group MGT101 Financial Accounting
23 minutes ago
abdul ghafoor replied to + M.Tariq Malik's discussion PSY404 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 20-11-2019 in the group PSY404 Abnormal Psychology
24 minutes ago
abdul ghafoor replied to + M.Tariq Malik's discussion PSY404 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 20-11-2019 in the group PSY404 Abnormal Psychology
25 minutes ago
Profile IconAli Haider, samar bilal and + '' Tanveer '' joined + M.Tariq Malik's group
32 minutes ago
ALEENA replied to + M.Tariq Malik's discussion How to Prepare The Mid Term Exams & Study in VU
37 minutes ago
Isha Chuhdary updated their profile
38 minutes ago
ALEENA replied to + M.Tariq Malik's discussion How to Get Full Marks In Quiz
46 minutes ago
ALEENA liked + M.Tariq Malik's discussion How to Get Full Marks In Quiz
47 minutes ago
ALEENA replied to +¢αяєℓєѕѕ gιяℓ's discussion Kya Mien Writer Ban Sakti Hoon :-P
56 minutes ago
Misha Rajpoot liked + M.Tariq Malik's group MTH202 Discrete Mathematics
1 hour ago

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

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