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"
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):";
cout<<"Enter Your City(Without Space):";
cout<<"Enter Your Experience(Without Space):";

return 0;

i also used the ofstream but the diff was nil

Recommended Answers

All 3 Replies

Member Avatar

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

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

Member Avatar

Ya it was.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.