j'ai ce code :
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
writeFile();
}
int writeFile ()
{
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile << "Writing this to a file.\n";
myfile << "Writing this to a file.\n";
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
Pourquoi cela ne fonctionne-t-il pas ? ça me donne l'erreur :
1>------ Build started: Project: FileRead, Configuration: Debug Win32 ------
1> file.cpp
1>e:\documents and settings\row\my documents\visual studio 2010\projects\fileread\fileread\file.cpp(8): error C3861: 'writeFile': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
et ce n'est qu'une simple fonction. J'utilise Visual Studio 2010.