To automatically fill in input to a program that promts using cin>>, use this from the command prompt:
$programName < commands.txt Including files correctly
main file:
> #include “functions.h”

functions.h:
> #include
> using namespace std;
> function or class prototype non–void eg: int foo(string);

funtions.cpp:
> #include “functions.h”
> function definition eg: int foo(string mystring){ }

makefile
> g++ -c main.cpp functions.cpp;
> g++ -Wall main.o functions.o -o programname

Leave a Reply

Your email address will not be published. Required fields are marked *