Is this code valid, or is it the compiler?
<pre><code>int cpu = 0;
int player = 0;

char * getPoints()
{
    using namespace std;
    string str = "You: ";
    str += player;
    str += " CPU: ";
    str += cpu;
    char c [100];
    strcpy(c, str.c_str());
    return c;
}
</code></pre>

<p>This code doesn't compile. Is the code wrong or is there something wrong with my compiler?</p>

<p>I'm using <code>Microsoft Visual Studio</code> with the <code>DarkGDK</code>.</p>

<p>If it is me, can someone improve it?</p>

<hr>

<p>This is the output:</p>

<pre><code>1&gt;------ Build started: Project: Pong, Configuration: Debug Win32 ------
1&gt;Compiling...
1&gt;Main.cpp
1&gt;c:\users\martijn\documents\visual studio 2008\projects\pong\pong\main.cpp(42) : warning C4172: returning address of local variable or temporary
1&gt;Linking...
1&gt;libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &amp;,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
1&gt;libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &amp;,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
1&gt;libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)
1&gt;Debug\Pong.exe : fatal error LNK1120: 3 unresolved externals
1&gt;Build log was saved at "file://c:\Users\Martijn\Documents\Visual Studio 2008\Projects\Pong\Pong\Debug\BuildLog.htm"
1&gt;Pong - 4 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</code></pre>
