Hello there, I think I have a weird problem with a program I'm writing, specifically, a function to create a file. I made the following program just to test the important part of the problem, which is that it won't create the file. Here's the code.
#include <fstream.h>
#include <iostream.h>
#include <conio.h>
ifstream fin;
ofstream fout;
void wrtfile(char b[15])
{
fout.open(b);
fout << "Hello there" << endl;
fout.close();
}
void main()
{
char a[15];
a == "Hello.txt";
wrtfile(a);
}
I mean, from what I've seen around the forums and the web, it should run perfectly, and it does run, but it doesn't create the file. I don't know if it is because of the compilator I'm using: Turbo C++, or if I'm missing a library. Thanks in advance for any help you can provide.