warning C4013

Hello, I'm using Visual C++ 2003 Standard for ansi C coding.
I keep getting warning like this with common functions:

warning C4013: 'malloc' undefined; assuming extern returning int
warning C4013: '_getch' undefined; assuming extern returning int
warning C4013: 'strcpy' undefined; assuming extern returning int
warning C4013: 'free' undefined; assuming extern returning int

How to solve it
Thank you in advance.




Answer this question

warning C4013

  • lordcornholio

    #include <stdlib.h>
    #include <string.h>

    Those 2 will take care of malloc()/free()/strcpy().

    _getch() is non-standard function. You probably can use getchar() instead.

    Thanks,
    Eugene

  • tobimat80

    Thank you, it works.


  • warning C4013