Back my popular demand, greatness2 is here!!

This is a discussion on Back my popular demand, greatness2 is here!! within the C++ Programming forums, part of the General Programming Boards category; Remember my first program? Well, heres the sequel....

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

    Back my popular demand, greatness2 is here!!

    Remember my first program? Well, heres the sequel.
    Attached Files Attached Files

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    A) What is the point of the post?

    B) Why do you use define statements that are not needed?

    C) Try taking the entire name as one string using getline. Therefore, the user doesn't have to hit enter twice.

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

    ......

    *playing with his sleeves*
    Huh? Ok, sure, whynot?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    I ran an earlier version of this program and it worked to some extent, but the two biggest problems that I have with this program (aside from the complete lack of portability) is this:
    Code:
    #define group class
    
    group program_variables
    {
      public:
      int mainresponse;
      unsigned int age;
      char name[25];
      char lstname[25];
      char gender[7];
      char personality[25];
      char hobby1[20], hobby2[20], hobby3[20];
      void calculator();
      void stalker();
      void watch_loop();
    };
    First, redefining a common keyword just obfuscates the code, and hides spelling errors if you use an IDE that will make keywords a different color. When learning a language, use it correctly until you understand what rules you can bend and how to do so without creating new bugs. The second problem is that you make every member public in your class. If you don't care about data hiding then you might as well just use a struct and not pretend you're writing an object oriented program.

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

  5. #5
    Registered User JasonLikesJava's Avatar
    Join Date
    Mar 2002
    Posts
    175

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    Yeah Jason, I said the same thing. I'm an intermediate in C++ so I know what I'm doing. The purpose of my posting my program is for you to enjoy the .exe file. If you want to correct my .cpp file e-mail me at Ruflano@hotmail.com

    My style of C++ coding is much different from you guys.

  7. #7
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Could someone tell me what the Sleep() command does and it's syntax.....it seems quite interesting.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  8. #8
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    hey you're using STYC++ in 21 Days right? Because I see Frisky and Fout.....
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  9. #9
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >If you want to correct my .cpp file e-mail me
    If you don't want comments on your code then post the .exe on the GD boards. These are discussion forums on programming, if you post code then people will discuss the code. As for emailing, don't expect it since one of the benefits of discussion is getting different persepctives as opposed to just one person offering suggestings in an email.

    >Could someone tell me what the Sleep() command does and it's syntax
    The sleep function is a function that simply causes a delay, the argument is the number of miliseconds that the delay will last.

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

  10. #10
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    oh cool so this would work............


    int x;
    x=125;


    Sleep(x);


    ?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  11. #11
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Yes

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

  12. #12
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    Sleep(x) is a great function. Is there another function like it?

  13. #13
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Code:
    
    Wake (NOW!!!);
    
    Wake ( IN '5');


    j/k I don't know ......it is pretty cool.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  14. #14
    Registered User
    Join Date
    Jan 2002
    Posts
    106
    uhh...I didn't laugh at that joke. Was that suppose to be funny? Was that some nerdy joke you guys do?

  15. #15
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Wake ( IN '5');
    Or the equivalent macro
    snooze();

    But don't forget to include early.h

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

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Back to the drawing board
    By VirtualAce in forum Game Programming
    Replies: 11
    Last Post: 03-08-2004, 05:53 PM
  2. "if you love someone" :D
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-02-2003, 02:10 AM
  3. UInt to CString and back
    By xlnk in forum Windows Programming
    Replies: 6
    Last Post: 08-27-2003, 04:08 PM
  4. Some woman back ended my car today, and back hurts
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 08-20-2003, 01:42 AM
  5. Yey Im Back!
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 07-05-2003, 04:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21