win32 code help needed, please its urgent

This is a discussion on win32 code help needed, please its urgent within the Windows Programming forums, part of the Platform Specific Boards category; What is the output for following code? [code] WCHAR wszStr[] = L"01234"; WCHAR *pwsz = NULL; pwsz = (WCHAR*) malloc ...

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

    Thumbs up win32 code help needed, please its urgent

    What is the output for following code?

    [code]
    WCHAR wszStr[] = L"01234";
    WCHAR *pwsz = NULL;
    pwsz = (WCHAR*) malloc (5);
    wcscpy (pwsz, wszStr);

    [\code]
    a) stack overflow
    b) buffer overrun
    c) compiler error
    d) access voilation

  2. #2
    Registered User
    Join Date
    Nov 2008
    Posts
    162
    pls help me

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    2,590
    I know of two likely outcomes, only one of which is listed in the answers. what do you think the answer is, and why?

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    162
    Quote Originally Posted by Elkvis View Post
    I know of two likely outcomes, only one of which is listed in the answers. what do you think the answer is, and why?
    i got this error while running it

    Line 1: error: 'WCHAR' does not name a type
    compilation terminated due to -Wfatal-errors.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. urgent help needed win32 c++ code , please help me!!!!
    By leo2008 in forum Windows Programming
    Replies: 1
    Last Post: 03-12-2013, 11:22 AM
  2. Urgent, help needed.
    By sinnclaus in forum C Programming
    Replies: 4
    Last Post: 03-29-2010, 07:08 AM
  3. Urgent Help needed!
    By Superstar90 in forum C++ Programming
    Replies: 3
    Last Post: 11-10-2009, 04:21 PM
  4. Urgent Help Needed Please!
    By silhoutte75 in forum C Programming
    Replies: 2
    Last Post: 11-09-2007, 10:25 PM
  5. Urgent help needed!!!
    By gibs21 in forum C Programming
    Replies: 2
    Last Post: 09-26-2002, 02:45 PM

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