0

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

Edited by a.muqeet khan: n/a

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by v3ga
0

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

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.