All pastes #480702 Raw Edit

Miscellany

public cpp v1 · immutable
·published 2007-05-10 12:10 UTC
rendered paste body
sqaure.cppdouble square(double n){    return n * n;}main.cpp#include <iostream>#include <cstdlib>using namespace std;double square(double);int main(int argc, char *argv[]){    // Make sure the argument count is 2, otherwise display the help    if (argc != 2){        cerr << "Usage: square <number>" << endl;        return 1;    }    // String to double of Argument 1.    double n = strtod(argv[1], 0);    // Call the square method in square.cpp and display it on the screen.    cout << "The square of " << argv[1] << " is " << square(n) << endl;    return 0;}