Author Topic: Help needed >.<  (Read 3344 times)

XGenesisX

  • Guest
Help needed >.<
« on: February 27, 2009, 12:59:51 pm »
i am learning C++ language now and doing console application using codeblock
i just want to ask if there is any way to access the data that are stored outside of the codeblock program.
For example,i do not want to key in the input inside the console window. i wan to access the data that is stored outside codeblock when i type in the command.(For example,i wan to access the data in ggg.txt)
is it possible to do it with codeblock?
« Last Edit: February 28, 2009, 04:34:47 am by XGenesisX »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Help needed >.<
« Reply #1 on: February 27, 2009, 04:02:44 pm »
Quote
For example,i do not want to key in the input inside the console window. i wan to access it when i type in the command.
Welcome  to the forum.
Sorry I can't follow your mind. More specific please.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Help needed >.<
« Reply #2 on: February 28, 2009, 12:33:21 pm »
If you want to access data in a file such as ggg.txt, then you need to open that file and read from it. This has nothing to do with Code::Blocks, and we won't teach you how to do that, since it's basics of programming, not Code::Blocks.

You need to learn how to use either the C++ iostream functions or the C stdio functions (which I personally perceive easier). Searching the internet for either of those terms will lead you to the documentation.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."