Translate Code

I am having trouble translating this fortran code to c++. I am running a program on lid driven cavity and have everything done except for several lines.


real :: strf(0:nx,0:ny)

open(unit=3,file='data1.csv')
open(unit=4,file='data2.csv')
open(unit=5,file='data3.csv')

and


write(3,*)u(i,j)
write(4,*)v(i,j)
write(5,*)strf(i,j)

could someone help me translate this to c++? I think I'm suppose to use the "ofstream" operator but i'm completely lost

Thanks!
What is the code suppose to do? It would be easier to give you an answer if you just had written the purpose of the code instead of just writing an other language and expect a translation. Comment tags would help too.
Look at http://www.cplusplus.com/doc/tutorial/files/ and if you have any other specific questions, then don't hesitate to ask.
Thanks NT3! I found what I needed and have my code up and running
Topic archived. No new replies allowed.