Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

Read Input from a File

(1/2) > >>

dedachi:
Hello,

Consider I have a program which has to get input from a file containing some data.
In gcc, the indirection/redirection operators work.

So I would do:

./a.out < readfromFile.txt  and values from a txt file will be read into the program.


I am confused how could I do this using codeblocks?
Please advise.

Thanks

oBFusCATed:
You can't if I remember correctly.
You should start your program in terminal

MortenMacFly:

--- Quote from: dedachi on March 03, 2010, 05:07:39 pm ---I am confused how could I do this using codeblocks?

--- End quote ---
You can use the tool menu for that.
Setup a tool that uses the appropriate macros to point to your application which is being piped into a batch file or alike.

dedachi:

--- Quote from: oBFusCATed on March 03, 2010, 05:26:04 pm ---You can't if I remember correctly.
You should start your program in terminal

--- End quote ---

Please can you give an example of this?

dedachi:

--- Quote from: MortenMacFly on March 04, 2010, 06:47:45 am ---
--- Quote from: dedachi on March 03, 2010, 05:07:39 pm ---I am confused how could I do this using codeblocks?

--- End quote ---
You can use the tool menu for that.
Setup a tool that uses the appropriate macros to point to your application which is being piped into a batch file or alike.

--- End quote ---

Sorry, I am new to codeblocks.
Can you please explain further or supply an example?

Thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version