954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

file handling problem

guys i have a prob i wrote the code for file handling the prob is that the code is working perfectly it also creates the file yet it doesnt store any thing in it and after the del the files it created in my hard disk he wont create any more either here is the code

// file handling flag testing and practise.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
#include<cstdlib>
#include<fstream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])


{
 fstream out("D:myfoldertest.txt");
char name [10];
int experience;
char city [10];
cout<<"Enter Your Name(Without Space):";
cin>>name;
cout<<"Enter Your City(Without Space):";
cin>>city;
cout<<"Enter Your Experience(Without Space):";
cin>>experience;
cout<<name<<"\t"<<city<<"\t"<<experience<<endl;

system("pause");
return 0;
}


i also used the ofstream but the diff was nil

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
 

You are not writing to the file. Then how can you expect it to be written?
Use proper formatting

v3ga
Junior Poster in Training
95 posts since Oct 2011
Reputation Points: 14
Solved Threads: 4
 

thanks it was a silly silly mistake i should have used out instead of cout i am sorry a silly mistake none the less

a.muqeet khan
Light Poster
27 posts since Mar 2011
Reputation Points: 6
Solved Threads: 0
 

Ya it was.

v3ga
Junior Poster in Training
95 posts since Oct 2011
Reputation Points: 14
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: