Author Topic: Help linking a txt file to .EXE not a folder  (Read 7000 times)

Offline frogs777

  • Single posting newcomer
  • *
  • Posts: 2
Help linking a txt file to .EXE not a folder
« on: September 14, 2013, 09:34:15 am »
Hi, Im new to C++ and currently taking a C++ course.  I decided to use code blocks for its more modern approach to programming and Ive come across a problem during some homework.

So the hw im doing is linking a text file to code.  No problem getting this to work but the HW instructions say "that means the input and output files need to be in the same folder as your compiled and linked excutable code (your EXE file)." Not sure what this means, as I am using the CodeSnippet for the input and output folder, and it simply seems to link to the folder to my computer not the .EXE. Gunna need some help on this one, because Im not following what this means or how to do it at all. And Im not seeing any instructions on how to do it anywhere. The Streaming in and out concepts no problem, how to actually link them in the compiler with .EXE?

If I make a new folder for hw4pr2 and place hw4pr2input.text within it? This will still display a ("C:\Documents and Settings\etc) anyhow in the code from the linked codesnippet.

as in:

in_stream.open ("C:\Documents and settings\HW\HW4\hw4pr2input.txt")


thanks

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Help linking a txt file to .EXE not a folder
« Reply #1 on: September 14, 2013, 03:58:23 pm »
Apologies, but these forums are targeted at use/development of Code::Blocks itself, not general programming support.  If you need specific help on some Code::Blocks settings, you can ask here, but otherwise, try general purpose forums such as http://stackoverflow.com/.

Offline frogs777

  • Single posting newcomer
  • *
  • Posts: 2
Re: Help linking a txt file to .EXE not a folder
« Reply #2 on: September 14, 2013, 04:41:52 pm »
great thanks for the help