Thread: Beginner Question - Linking a data file

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Beginner Question - Linking a data file

    I've just begun to teach myself C++ and am using the DevC++ compiler. I've been trying to discover how to build and link a data file to a C++ program (the program calc's gross tonnage of a seagoing vessel) in DevC. Their website is not helping me. Can anyone here point me in the correct direction or give me a clue as to how I can create a data file???

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You create a data file with something along these lines:
    Code:
    #include <iostream>
    
    ...
       std::ostream astream("outfile.txt");
       astream << "This is my data" << std::endl;
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Please Help Reading Data From A File
    By NickHolmes in forum C Programming
    Replies: 5
    Last Post: 05-29-2005, 11:24 PM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM