File Handling in c++

Hello everyone,

I am working on my Project and new to c++. I have a question related to csv file. So, I am working with multiple cpp file in a same Project (for example main.cpp, first.cpp and second.cpp). In main.cpp, I am creating two csv file which have different Name wherever I run the Code and I both open csv file, writing 1st row in both csv file and then Close it. Now my question is if I wanted to open and write on these both csv file in first.cpp and second.cpp then is it possible? If yes then how can I do that? Any help will be appriciated. Thank you in advance.


//main.cpp
void createcsv1()
{
//creating csv file1 and writing first row
}
void createcsv2()
{
//creating csv file2 and writing first row
}
int main()
{
void createcsv1();
void createcsv2();
System ("pause");
return 0;

//first.cpp


//second.cpp
Last edited on
Topic archived. No new replies allowed.