This looks like your homework to me, but...
1) Try it! Add that line to your favorite C / C++ compiler, and build it. Does the compiler complain?
2) Well, the compiler won't complain...but that doesn't mean it's a good idea. See here:
http://en.wikipedia.org/wiki/Dangling_pointer[
^]