I'm going to try not to do your homework for you and at the same time help you out.
do some homework on fstream/iostream/ and common string functions like atof()
all file input/output will be in TEXT format. not Binary
hope this helps. but as they said eariler the porblem is perty much self explanitory(forgive my spelling.)
float number_1; // i'm using float to make you do some research.
//refer to other parts of this site for error checking.
//first lets get some room to work.... by that i mean storage space.
p = new char;
//error checking again
memset(p,0,100); //clear the work space;
inputfile.read( p ); //<< more homework here.
//now your buffer p should contain your entire text file.
//TIP 1: the lines in the file will be sepraerated by '\n' and not \0
//now lets read the first line.
magical_function_you_need_to_write_to_find_where_newline_is( p );
//Image we have another file called outputfile
//please note the above function.
//anyway enought TIPS 2:
//Now we just got the numbers.
number_1 = atof(p);
number_2 = atof(p);
number_3 = atof(p);
if( (number_1 + number_2) != number_3)
exit(1)//10+20 != 30 then something is wrong. but i am using float's. hehehe
std::cout "The sum of \"" << number_1 << "\" and \"" << number_2 " = \"" << number_3;
basicly the excersize is to get you familer with file input/output and get you using the std libary. after you learn how to get JUST what you want out of a file you can start learning the printf and _snprintf() functions.