Thread: this takes the cake... microsoft is the saddest company ever!

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

    this takes the cake... microsoft is the saddest company ever!

    run this code on Visual Studio 6 in debug mode
    Code:
    #include <iostream>
    #include <ctype.h>
    int main() 
    {
      if (isalpha('æ'))
        cout << "this is sad" << endl;
      else
        cout << "okay" << endl;
      cin.get();
      return 0;
    }

    Various other characters will also return true. Interestingly, in debug mode, isalpha works correctly....
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Hmm weird...

    I removed the cin.getline() and it worked ok.......

    Also, when I jumped to one of the other libraries (multithreaded or multithreaded dll) it worked ok......strange though

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Please don't call Microsoft sad because of 1 mistake in their
    compiler, i think MSVC is THE ultimate compiler, every compiler
    has its mistakes

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    First, this code will not compile in VC++ 6. Using <iostream> and taking no heed of the std namespace is an error, once that was taken care of the output was "okay".

    >every compiler has its mistakes
    Yes, but VC++ 6 has more bugs than normal. These were mostly fixed in VC++ .NET though.

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

  5. #5
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    i still say vc++ has the best debugger out, hands down.

  6. #6
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    Originally posted by Ride -or- Die
    i still say vc++ has the best debugger out, hands down.
    You've never programmed with ADA have you.
    Look into it, when you use the GNAT tools and debuggers the debugger actually (nearly) talks to you. It tells you the error, what you probably did wrong, it even checks the spelling (misspelled variables and corrects them), it also makes suggestions as how to fix it. THAT is the best debugger....
    But for C/C++ I'd agree.
    PHP and XML
    Let's talk about SAX

  7. #7
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343
    i dont even know how to use any debuggers. for some reason, they just frig up my programming code to make it worse! i set the break points, but thats all i really know how to do, when i press debug, nothing EVER happens. how do i use a debugger to my advantage!?!
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  8. #8
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    >First, this code will not compile in VC++ 6. Using <iostream> and taking no heed of the std namespace is an error,

    You sure live up to the subtitle "Nitpicker extraordinaire"

    Interesting, I just tested that code in a separate project and "this is sad" is the output on mine, even in debug mode. Perhaps you have a service pack installed or something. Also, Im using EE, that might make a difference.
    Last edited by *ClownPimp*; 01-04-2003 at 01:47 PM.
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  9. #9
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    I don't have time to fiddle with this right now, but perhaps the local settings should be considered.

    "æ" is an alpha character in the Danish language, as are ø, and å. Note for the pedants, these are true vowels in our alphabet, they are not "accents". It would irritate me if isalpha('æ') returned FALSE.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  10. #10
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Hmmm... Isn't 'æ' an alphabetic character?
    The function isalpha() returns non-zero if its argument is a letter of the alphabet. Otherwise, zero is returned.
    There's also another version of isalpha that takes a character and a const locale&.
    I haven't used locales much (read: not at all), but couldn't that be an solution?
    Last edited by Sang-drax; 01-04-2003 at 02:43 PM.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  11. #11
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    Consider this quote from the Visual C++ documentation...

    isalpha returns a non-zero value if c is within the ranges A – Z or a – z.
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  12. #12
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Could be a mistake/overlook in the documentation then perhaps?

  13. #13
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by *ClownPimp*
    Consider this quote from the Visual C++ documentation...
    It doesn't say that it will return 0 for every other case!
    There's a difference between "if" and "if and only if"
    In fact:
    The result of the test condition for the isalpha function depends on the LC_CTYPE category setting of the current locale
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  14. #14
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    Hmmm. I did not notice that
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. M$ phone suit
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 12-26-2002, 05:58 PM
  3. Microsoft rulling
    By Sentaku senshi in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-02-2002, 03:50 AM
  4. HaHa Sun takes Microsoft to court
    By Megatron in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 03-09-2002, 09:21 PM
  5. Retaliation towards witch king\microsoft
    By Koshare in forum Linux Programming
    Replies: 7
    Last Post: 10-19-2001, 04:54 AM