Thread: Nasty Char-Input-into-Int Bug

  1. #16
    Registered User
    Join Date
    Sep 2011
    Posts
    8
    Quote Originally Posted by CommonTater View Post
    Go back and look at post #9 ... I tested that on my own system and it works just fine.

    Stop reposting what I posted... Post your *actual* code... lets see what you are doing wrong!
    Listen, punk, I HAVE been posting my *actual* code, I have even been posting edits I've made and telling you where I've been putting them. If you are not smart enough to understand what that means, go back to school. I have tried your code, I have looked at it over, and it DOES NOT WORK!!! And the other thing: exit(0) is not recognized in the compiler on its own! I do not know what YOU are using, but that's not the way it is! Are you using a different header? If not, where is that? Why do you not mention that in your post?? I ain't going to put up with being insulted and flamed by some cocky veteran who thinks everyone is up at his level. I am a COMPLETE NOOB to this. Do you think I'm going to get it all like YOU do? NO!

    Thanks for wasting my time and making yourself look like an ass in front of the world. It was a mistake for me to even sign up for this forum. Why the HELL are you even here if all you're going to do is insult people and call them liars just because the code you use and have no problem with doesn't work on someone else's machines? Go to hell.

  2. #17
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by kowit010 View Post
    When I do this:
    If you want a 4 th case... use a 4th case...

    Code:
    int main(void)
    {
        menu();
        while (1)
          {	
             switch (getchar())	
                {
                   case '1':
                       pointsTotal();
                       break;
                   case '2':
                       pointsConference();
                       break;
                   case '3':
                       pointsTeam();
                       break;
    
                    case '4' :
                           printf("Peace Out....");
                           exit(0); 
                    case '\n' :
                            printf("Please enter a selection from the menu...");
                            break; 
                    
    
                    default:
                       printf("\nInvalid entry! Please try again!\n\n");
                       menu();
              }
    
          }	
        return 0;
    }
    The case 4 exits the program.
    The \n has to be processed because you are actually entering 2 characters... the selection and the enter key.

  3. #18
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by kowit010 View Post
    Listen, punk ... It was a mistake for me to even sign up for this forum.
    Yeah well... don't let the door hit yer backside on the way out...


    With that kind of temper, we don't need you here at all... You never once followed my examples or instructions... and the little matter of exit() could have been resolved by spending 10 seconds looking it up in your help files...
    Last edited by CommonTater; 09-18-2011 at 09:17 AM.

  4. #19
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by CommonTater View Post
    With that kind of temper, we don't need you here at all... You never once followed my examples or instructions... and the little matter of exit() could have been resolved by spending 10 seconds looking it up in your help files...
    There you go again using standard code and expecting it to run on every standard compliant C compiler. Really, Tater where do you get off?
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  5. #20
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I know... sometimes I can be such an idealist...

    (Realizing that post #14 was the first time we saw his actual code, which was not my suggestion at all...)
    Last edited by CommonTater; 09-18-2011 at 12:40 PM.

  6. #21
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    I still can't feagure out why he snapped so suddenly. Tater didn't say anything bad or insulting ... I guess when the real intensions of someone are unmasked, he becomes angry to defend himself... ( I should be a psychologic! )
    Devoted my life to programming...

  7. #22
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by GReaper View Post
    I still can't feagure out why he snapped so suddenly. Tater didn't say anything bad or insulting ... I guess when the real intensions of someone are unmasked, he becomes angry to defend himself... ( I should be a psychologic! )
    It's pretty obvious he was getting very frustrated, wasn't thinking clearly... and likely has a problem following instructions to begin with.

    Coders with that temperment don't last long... but I'm told they make excellent landscapers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Something Nasty
    By string in forum C Programming
    Replies: 4
    Last Post: 06-01-2008, 01:28 PM
  2. How can terminate input when input specifed char?
    By Mathsniper in forum C Programming
    Replies: 5
    Last Post: 12-11-2006, 09:59 AM
  3. Function input may char or char[] ..?
    By GSalah in forum C++ Programming
    Replies: 2
    Last Post: 11-15-2006, 04:07 AM
  4. Nasty looking thing
    By richard_hooper in forum C Programming
    Replies: 3
    Last Post: 05-27-2005, 09:40 AM

Tags for this Thread