Hi experts, I\'m taking a c++ class, and I have difficulty of reading file and s
ID: 3576093 • Letter: H
Question
Hi experts,
I'm taking a c++ class, and I have difficulty of reading file and save data into array, could anyone please help me out?
The following are the examples:
Let say if a file name "test.txt", and the content inside of this files are:
------------------------------------------------------------------
001 Name1 567
002 Name2 789
003 Name3 (empty here)
004 Name4 101
005 151
006 199
------------------------------------------------------------------
Basically, the above information are the contents information. And I want to know, how to read file and store the first column (001, 002, 003, ... 006) as an Id or number, and the second colunmn (Name1 ..Name 4) are string, *important* in 005 and 006 row, the data become a number *. For the third colunm, (567, 789, ,101 , ,) are the numbers, the empty meaning there are nothing, and we have to consider there is nothing to read.
Overall,could anyone please help me to write a simple c++ code that read the above file and store the information properly?
(Note: Please no hard coding, the above just example create by myself, I really want to learn the coding)
Thank you so much for those who spending time look at this question and work on it.
Hope you would have a wonderful day!
Explanation / Answer
It is common, in net applications, to examine main menu things across the highest of a page, with sub-items either underneath the most menu or on the left or right facet of the page. Access 2010 is meant to form it straightforward to make web-targeted information applications, and also the new navigation forms feature makes it straightforward to make customary user interfaces for the online. additionally, these interfaces are often helpful in shopper applications. This Visual the way to shows the way to produce associate degree Access 2010 kind by victimisation the new navigation kinds feature and can investigate the sample form that's shown in Figure one.
Figure 1. Sample kind
Sample kind
Code It
In Access 2010, open the Northwind sample information. (To retrieve the Northwind sample information, choose File, select New, then choose Samples. From the list of workplace.com samples, choose Northwind 2007.) Open the new sample information, bypass the logon kind, and within the Navigation Pane, cluster the objects by sort. within the produce tab, choose the Navigation choice, that displays the six completely different layouts from that you'll be able to choose after you area unit making a navigation kind (see Figure 2). you'll be able to choose to rearrange navigation tabs across the highest during a single row, or across the left or right sides of the shape. For multiple levels of tabs, you'll be able to position them in 2 rows on the highest of the shape, or across the highest then down the left or right facet of the shape. For this instance, choose Horizontal Tabs and Vertical Tabs, Left. Click the title, Navigation kind, and alter it to Manage Entities. after you area unit finished, the shape ought to match Figure three.
Figure 2. Navigation kind layout alternatives
Navigation kind layout alternatives
Figure three shows a kind with a changed title.
Figure 3. kind with changed title
Form with changed title
Create the commanding Tabs
The sample kind ought to show commanding choices to figure with customers, employees, and product. to induce started, click the Add New button at the highest of the navigation kind, and alter the text to Customers; Access can add a brand new tab. Repeat this method, making tabs for workers and product. after you area unit finished, the tabs ought to match Figure four.
Figure 4. commanding tabs layout
Top-level tabs layout
Create the Second-Level Tabs
With the commanding tabs, it's straightforward to feature forms and reports to be displayed once users click secondary tabs, on the left facet of the shape. begin by clicking the purchasers commanding tab. From the Navigation Pane, drag the client List kind onto the Add New tab on the left facet of the shape. This creates a brand new association between the navigation button and also the existing kind, setting the button Navigation Target Name property in order that it refers to the desired kind. Repeat this method, adding the client Phone Book and client Address Book reports to the tabs on the left.
Click the workers tab at the highest of the shape, and from the Navigation Pane, drag the workers List kind to the Add New tab on the left of the shape. Repeat this step with the worker Address Book and worker Phone Book reports. Click the product tab at the highest, and drag the merchandise Details kind to the tabs on the left. Repeat this step with the four product-related reports. Save the new kind with the name Entities. Now, the shape ought to match Figure one. show the shape in kind read, and act with the varied tabs, moving from Contacts to staff to product, and verify that the second-level tabs work properly.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.