Help opening a file usig data structure

Write your question here.
Doing a project but i dont know how to even start. Here are the instruction

This program shall:
• open the DB file: TestDB.dat
• read it into your structure array,
• display it on the screen, and
• write it to an output text file named: testout.dat

and the TEST DB file contains this info
RS001
McAllister, Billie Joe, Dean
123-89-4321
+1 775-332-4581
WF0342 75000.00 4.85 12
SB1942 100000.00 3.5 12
BA0001 23988.88 7.5 12
VG003
van Gogh, Vincent, Willem
945123-88822
+31 20 570 5200
ART015 100.00 2.5 12
C123A
James Jr., Jesse, Woodsen
323-77-2134
(816)736-8500
Z52C42 126812.33 5.0 1
XXXC42 75000.00 4.5 12
JJ1847 34009.05 2.5 12
JJ1882 1004.03 0.5 12
CC1492 19754.00 3.55 4

the first step is to open file and read the data but i cant even do that.
Any help will be great!!
the first step is to open file and read the data but i cant even do that.

No the first step is to define your structure. Show your structure definition.

In the sample given how do you know when one record ends and another begins?

Okay did that and this is what my structures look like

struct Item_Info{
char ACC_num[20];
unsigned int c_y
double rate;
double balaance;
};

struct Customer{

char name[];
char cust_id[];
char phone_num[];
char tax_num[];
Item_Info[5];

};

PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

Now you need to answer jlb's second question.

In your Customer struct, you must give your char[] variables explicit sizes.



i gave my char[] variables sizes and this is what i have so far


#include <iostream>
#include <fstream>

using namespace std;

struct Item_Info{
char Acct_num[20];
unsigned int c_y
double rate;
double balance;
};

struct Customer{

char name[50];
char cust_id[50];
char phone_num[50];
char tax_num[50];
Item_Info[50];

};

int main()
{
/*
*/
return 0;
}

jlb what do you mean how i know when one record ends and another begins??
so for example this an account for one customer and I'm suppose to read each individual line.

RS001 // cust id
McAllister, Billie Joe, Dean // lname. fname, mnane
123-89-4321 // tax id
+1 775-332-4581 // phone number
WF0342 75000.00 4.85 12// Account number, Balance ,Rate, year
SB1942 100000.00 3.5 12// Account number, Balance ,Rate, year
BA0001 23988.88 7.5 12 // Account number, Balance ,Rate, year

You have been asked multiple times to use code tags. PLEASE DO SO.
If you're not going to make the slightest bit of effort to make your posts readable, why should we spend the slightest bit of effort helping you?
I will not respond further until you apply code tags.
> You have been asked multiple times to use code tags
I see just one: http://cplusplus.com/forum/general/268569/#msg1155598
besides, the interface is awful and buggy and I don't care.

> what do you mean how i know when one record ends and another begins??
1
2
3
4
5
6
7
8
9
10
11
12
RS001 //cust id
McAllister, Billie Joe, Dean
123-89-4321
+1 775-332-4581
WF0342 75000.00 4.85 12 //account ...
SB1942 100000.00 3.5 12
BA0001 23988.88 7.5 12
VG003 //cust id
van Gogh, Vincent, Willem
945123-88822
+31 20 570 5200
ART015 100.00 2.5 12
¿how do you know that VG003 is a customer id and not another account from McAllister?
¿how do you know that McAllister has three accounts?

Item_Info[50];`Item_info' is a type, like char, int, double and Customer
you forgot to give a name to your variable, like you did with phone_num, cust_id, rate and balance
Topic archived. No new replies allowed.