doubt in win32 c++ code , please urgent help needed

This is a discussion on doubt in win32 c++ code , please urgent help needed within the Windows Programming forums, part of the Platform Specific Boards category; In Multibyte character set, what will be printed for the below code? Code: MessageBox(NULL, (LPCTSTR)L"Windows", NULL, MB_OK) a) "Windows" b) ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    162

    Thumbs up doubt in win32 c++ code , please urgent help needed

    In Multibyte character set, what will be printed for the below code?
    Code:
    MessageBox(NULL, (LPCTSTR)L"Windows", NULL, MB_OK)
    a) "Windows"
    b) "E" "W"
    c) "Error" "Windows"
    d) "Error" "W"

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,306
    What do you mean by "In Multibyte character set"?

    Unless you're clear on what you mean by that, your question is meaningless.
    Right 98% of the time, and don't care about the other 3%.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    7
    no entender

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    162
    multibyte characters (sequence of one or more bytes)

    Help - IBM AIX Compilers

    Unicode and Multibyte Character Set (MBCS) Support

    what do you think would be answer here?

  5. #5
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    162

    Thumbs up

    Quote Originally Posted by Niara View Post
    i guess its c)....what do you think?

  7. #7
    Registered User
    Join Date
    Nov 2008
    Posts
    162
    since prefix L represents unicode string here....but for muticharacter set, it will give error..am i correct?

  8. #8
    Registered User
    Join Date
    Mar 2013
    Posts
    7
    MING-W compiler:

    #include <tchar.h>
    ...
    ...
    #define _UNICODE
    _T("World"); // L"World" -> wchar_t
    #undef _UNICODE
    _T("World"); // "World" -> char

    Visual C++ compiler:
    http://msdn.microsoft.com/en-us/library/se784sk6.aspx
    Last edited by Joose; 03-17-2013 at 10:50 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c++ code, urgent please
    By leo2008 in forum C++ Programming
    Replies: 24
    Last Post: 03-13-2013, 02:43 AM
  2. c++ code urgent help needed
    By leo2008 in forum C++ Programming
    Replies: 22
    Last Post: 03-13-2013, 12:14 AM
  3. win32 code help needed, please its urgent
    By leo2008 in forum Windows Programming
    Replies: 3
    Last Post: 03-12-2013, 08:12 PM
  4. urgent help needed win32 c++ code , please help me!!!!
    By leo2008 in forum Windows Programming
    Replies: 1
    Last Post: 03-12-2013, 10:22 AM
  5. urgent help needed!!!
    By yosef_yaniv in forum C++ Programming
    Replies: 5
    Last Post: 12-08-2007, 11:36 AM

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