Thread: saveing

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    47

    saveing

    how do i make it so if i use a file input and output so that is will save the .txt file were i wont and not were the compiled program is...

  2. #2
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    you can read and write to a file from any specific location regardless of where your exe is located.
    Last edited by The Brain; 07-09-2005 at 02:40 AM.
    • "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

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    47
    Quote Originally Posted by The Brain
    you can read an write to a file from any specific location regardless of where your exe is located.
    i know you can but how?
    i need the code specificly

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    If you provide a full path as the filename, the file will be saved to that path. If you provide a relative path, it will be saved relative to the current directory when you run your program.

  5. #5
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    Originally Posted by firefly

    i know you can but how?
    i need the code specificly
    I invite ye' to check out this recent thread on file i/o.
    • "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

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    47
    im srry but my reply was put in the wrong thred i was going too quickly

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. saveing moves
    By Neoground1 in forum C++ Programming
    Replies: 7
    Last Post: 10-14-2002, 09:25 PM