Beginner Question - Linking a data file

This is a discussion on Beginner Question - Linking a data file within the C++ Programming forums, part of the General Programming Boards category; I've just begun to teach myself C++ and am using the DevC++ compiler. I've been trying to discover how to ...

  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-07-2007, 11:24 PM
  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, 02:58 PM

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