Where to store the data?

This is a discussion on Where to store the data? within the C++ Programming forums, part of the General Programming Boards category; Where do I store data that I don't want to disappear on the programs termination?...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    465

    Where to store the data?

    Where do I store data that I don't want to disappear on the programs termination?
    My computer is awesome.

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    You mean like a file?

    EDIT
    I like this tutorial,
    http://www.daniweb.com/techtalkforum...2&page=1&pp=15
    Last edited by MadCow257; 03-01-2005 at 07:36 PM.

  3. #3
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    look at the tutorials on this site on how to use functions of the <fstream> library to send and read data to a file.
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  4. #4
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    Send it to a file. That's the only way to save the data on a program's termination.

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    There's rarely ever an 'only' way. You could also, for example, write it to the registry (goes into a file somewhere, but it's still somewhat different). Or, send it to a server somewhere on the net, that stays online 24/7. Or, print it, and on next startup have the user scan the printed sheet and parse the image with some OCR algorithm to retrieve the data. Plenty of ways to store data
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Registered User
    Join Date
    Aug 2004
    Location
    San Diego, CA
    Posts
    313
    Ok, Hunter, that's.. pedantic. :P

  7. #7
    Registered User Kybo_Ren's Avatar
    Join Date
    Sep 2004
    Posts
    136
    If you want you could have another process and use IPC to send the other process the data, then read it back when you start the program again. Many ways to save the data, though the most common has already been mentioned: files.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 09:55 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  3. data read and store
    By jammi in forum C++ Programming
    Replies: 1
    Last Post: 12-30-2002, 04:39 PM
  4. C Programming Question
    By TK in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 07-04-2002, 08:11 PM
  5. Do you store store one off data arrays in a class?
    By blood.angel in forum C++ Programming
    Replies: 5
    Last Post: 06-24-2002, 01:05 PM

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