Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7844691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:58:00+00:00 2026-06-02T16:58:00+00:00

I have been given a project for class and am stuck on a part

  • 0

I have been given a project for class and am stuck on a part of it. The project has this table in it:

enter image description here

How can I create this information into a sequential file to read into a C++ program? It looks like this would be a 3 dimensional array. Am I looking too far into this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:58:02+00:00Added an answer on June 2, 2026 at 4:58 pm

    It depends on what you are trying to do. Typically if you are are just trying to read it in you can store it as a flat file. With flat files you typically have two common formats fixed length record or comma separate (there are other flat file formats you can implement but these are two common fomats).

    In fixed length record each record is a fixed length and each field is a fixed length.
    For example

    Turkey             1.00Swiss        .30Roll           .30Condiments         .10
    Pastrami           1.30Swiss        .40Roll           .30Condiments         .10
    

    In comma separated language you can do it like this
    Turkey,1.00,Swiss,.30,Roll,.30,Condiment,.10

    With fixed length record the con is that once specified and depending on who is the recipient of the file is your fields can never grow. For example if your price field is five spaces you max value ever would be 99.99 and you would have a hard time ever increasing the field size because it would no longer be compatible if some other application depende on it being 5 characters. Comma separated is a little more flexible because the separator is the comma. With comma separate you can usually have the fields grow in size because your comma is the separator.

    There is another option and that is to create a ini type of what I will call Domain Specific format as an example take a look below

    Sandwich: Turkey
    Deli Slice: Turkey,1.00
    Deli Slice: Swiss,.30
    Bread: Roll,.30
    Condiments: .30
    
    Sandwich: Pastrami
    Deli Slice: Pastrami,1.00
    Deli Slice: Swiss,.40
    Bread: Roll,.30
    Condiments: .10
    

    This format is more flexible because you can add more fields. For example lets say you have a new sandwich called a california and it required meat cheese and also avocado. You can extend it like this

    Sandwich: California
    Deli Slice: Turkey, 1.00
    Deli Slice: American, .30
    Deli Slice: Avocado, .50
    Bread: Roll,.30
    Condiments: .10
    

    With this third format and some careful programming your new sandwich will automatically be backwards compatible.

    Each of the files takes a different strategy for reading it in. There is something called parsing and each file would have a different approach.
    In the fixed length record the approach wouldnbe to read each column by character positions.
    In the comma separated file you would need to tokenize each line read in in C++ you have a strtok but if you use managed C++ .net i believe you have a string.split.
    With the third option you actually look for keywoards such as “Sandwich”, “Deli SLice” etc and then you also have to tokenize the itmes because they

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given a project to edit. I think this is a simple
I have been given new project which has many classes and I have to
I am taking a class in C++ and have been given my first project.
I have been given a new project module which involves fuzzy logic. It is
i have been given class with int variables x and y in private, and
n00b here (first Android project). I have been given a custom video codec that
I've been given some starter code for a project I have to complete in
In a project I am working on I have been given XML to work
I have been working on a project for my c# class at school. And
I have been asked to create a project in vb.net which needs to integrate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.