C++ data storage

This is a discussion on C++ data storage within the C++ Programming forums, part of the General Programming Boards category; I am working on a C++ project to make a statistics spreadsheet i.e. for a sports team. I need to ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    11

    C++ data storage

    I am working on a C++ project to make a statistics spreadsheet i.e. for a sports team. I need to know how to store data once it is entered. For instance I would like to be able to enter a stat like how many points a player scored in one game and be able to bring up that program at a later date and still have that entry available. Any help at all would be awesome.
    Last edited by aewing30; 04-28-2008 at 11:33 AM. Reason: spelling error

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    If your just wanting to use C++ console applications.
    std::cout //Show output on screen
    std::cin //get input from user
    std::getline //get input from user
    std::string //store string input
    std::ifstream //load from file
    std::ofstream //save to file

    will be of a lot of use. Any specific question can be answered more thoroughly.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    So I would use std:fstream to save the data to a file and then open the console and use ifstream to load the file again, or would I need to do an if statement or somethin like that in order to load the data to the original program/

  4. #4
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    just skip the console thing and you are close
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,407
    If you are looking for a spreadsheet kind of program, why not just use existing spreadsheet software?

    If not, then perhaps you would like to consider using say, a relational database?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    11
    well i'm doing it as a project in a programming class. I need to use c++. what is a relational database?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. data structure design for data aggregation
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-20-2008, 06:43 AM
  2. question about a working linked list
    By cold_dog in forum C++ Programming
    Replies: 23
    Last Post: 09-13-2006, 01:00 AM
  3. Reading a file with Courier New characters
    By Noam in forum C Programming
    Replies: 3
    Last Post: 07-07-2006, 09:29 AM
  4. All u wanted to know about data types&more
    By SAMSAM in forum Windows Programming
    Replies: 6
    Last Post: 03-11-2003, 02:22 PM
  5. C Programming Question
    By TK in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 07-04-2002, 07:11 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21