View Single Post
Old 10-22-2004, 04:48 PM   #4 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
Code:
#include <iostream>
#include <string>
#include <climits>

using std::cout;
using std::endl;
using std::cin;
what was wrong with his headers? i know it is your opinion that everyone should use the namespace format, but his code is legal and valid. why change it? i don't mean to be a jackass, i'm just trying to make the point that you don't need to rewrite someone's code if they are doing things mostly correctly and just don't fit in with your style/view of the right way to do things.

Code:
//Optional functions: depends on IDE.
void wait_for_enter();
not optional, it is required by c and c++ to provide a function declaration before using that function (except std* functions in c). compilers that don't enforce this are non-compliant, and code that does not include these is incorrect.

Code:
int main(int argc, char *argv[])
his main declaration was correct, why fix it?.

Code:
void wait_for_enter()
{
  ...
i'm glad to see this function. it's nice to have a non-platform dependent way of doing this.
joe_bruin is offline   Reply With Quote