>he expects us to just know it
Somehow I doubt that. Teachers typically do not ask you to do work when the topic was never covered. Perhaps it was a self-study assignment and you just weren't paying attention.
Code:
#include <stdio.h>
#include <stdlib.h>
...
/* Create a file, erase contents if it exists */
FILE *fp = fopen ( "data.txt", "w" );
if ( fp == NULL ) {
perror ( "fopen" );
return EXIT_FAILURE;
}
Code:
/* Write your data to the file and exit */
fprintf ( fp, "Toll = %e \m Norm = %e\n", toll, norm );
return EXIT_SUCCESS;
>i know it's coded in C... but that's all i know
You know, there are these fascinating devices that transfer data through an optical connection straight to your brain. These "books" as they are called, cover many topics, I'm sure you can find several on C and C++. But since most valid C is also valid C++, you should have no problem.