Thread: Who likes my program?

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    106

    Who likes my program?

    Its all of the functions I know so far.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Well, after fixing the syntax errors...

    The program itself is okay I suppose, I'd recommend psychiatric help, but otherwise it's okay

    Keep in mind that any use of conio is nonstandard and may not work on all systems. Your using expressions will not work, both because they are invalid as well as the fact that you are using the prestandard iostream. Namespaces were added after the prestandard iostream was replaced in support of the new one. A better way to do this would have simply been:

    #include <iostream>
    using namepsace std;

    Global variables are evil, avoid them if possible and use them only when absolutely necessary without any alternatives. Data hiding is one of the biggest attributes of C++, use it.

    I found your style a bit hard to follow at first, but that was only temporary. To give the reader of your code a better sense of control flow you might want to consider either switch statements or if...else if clauses instead of the mass of single ifs you have. On line 44 (after my original include changes) there was an error for missing a ; after the string. This was because you had a string variable followed by a string literal without the correct operator to separate them
    cout<<"\n\nGreat "<<frtname<<". What college will you be going to "<<frtname /*error here, missing <<*/ "? ";

    Also, you use the nonstandard functin getch() where a standard call to getchar() would serve just as well and without any noticeable difference.

    Just a quick note on the logic, for some reason the program thinks I'm a teenager when I enter 33...that may be a problem.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > I'm a teenager when I enter 33

    Also, you're not when you're 13.

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    106

    ok

    my apoligies

    I wasn't really done with it though.............

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM