си указатель на локальный массив возвращать нельзя - warning C4172: returning address of local variable or temporary

Forums:

warning C4172: returning address of local variable or temporary - это предупреждение из Си++ , но оно справедливо и в Си++ .

нельзя возвращать указатель на переменную инициализированную в области вызываемой фукции - так как в этом случае теряются - позже напишу подробнее.

http://forum.pellesc.de/index.php?topic=...

The error is caused because the address of the variable you are returning falls out of scope as soon as the function exits, so although you can return the address, as soon as the function exits the address is no longer valid, and your character buffer will be deleted.