0

Does anyone know how make 2d array of struct using file input output?

C++ program

11th May 2019, 1:27 PM
Afa_rraf
Afa_rraf - avatar
11 Antworten
0
What do you mean using file input output ? i can make a 2d array of a structure but how can you make it using the file input output i think you want to say implement it
11th May 2019, 2:58 PM
Sahil Bhakat
Sahil Bhakat - avatar
0
I mean how to make 2d array of struct..and then put it into file input output to be display...
12th May 2019, 12:15 AM
Afa_rraf
Afa_rraf - avatar
0
You can make a array like this: typedef struct{ int a; int b; }test; test t[2][2]; //you can just initialise it and use it later test t[2][2] = { {{2,4},{5,6}} , {{6,8},{4,7}} }; //Or you can do this t[0][0].b = 3; //and this too
12th May 2019, 4:54 AM
Sahil Bhakat
Sahil Bhakat - avatar
0
And tell me if you know file handling in c or not Because I think there is more than one way to do it And you can do it in the same way as it is done in c
12th May 2019, 4:57 AM
Sahil Bhakat
Sahil Bhakat - avatar
0
I want the 2d array connected to file input output but nevermind I will try using your technique first then I will proceed to the file input output...thanks
12th May 2019, 5:01 AM
Afa_rraf
Afa_rraf - avatar
0
Tell me first do you know C ?
12th May 2019, 5:05 AM
Sahil Bhakat
Sahil Bhakat - avatar
0
No I don't know...I just learning c++...sorry
12th May 2019, 5:05 AM
Afa_rraf
Afa_rraf - avatar
0
Ok no problem Tell me in the massage when you are ready for the file handling
12th May 2019, 5:08 AM
Sahil Bhakat
Sahil Bhakat - avatar
0
I just know the basic..ofstream ifstream that's all
12th May 2019, 5:09 AM
Afa_rraf
Afa_rraf - avatar
0
Ok
12th May 2019, 5:09 AM
Sahil Bhakat
Sahil Bhakat - avatar
0
https://www.geeksforgeeks.org/file-handling-c-classes/ Take a look at this , this will help you understand how to use file input output in c++
12th May 2019, 5:21 AM
Sahil Bhakat
Sahil Bhakat - avatar