Thread: win32 code help needed, please its urgent

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

    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
    222
    pls help me

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    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
    222
    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, 10:22 AM
  2. Urgent, help needed.
    By sinnclaus in forum C Programming
    Replies: 4
    Last Post: 03-29-2010, 06: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, 01:45 PM