static character pointer within a function
Hi All,
I am not sure all static variables define locally within a function is putting on stack memory or on the heap or global memory space.
Does anyone know?
Thanks!
DV007
Code:
class Foo
{
public:
Foo();
void convert_message_to_string()
{
static char * strbuffer; // is strbuffer on stack or heap after function return???
// convert an unpredict size of message struct into string, then return . With restriction of not allow using New operator or Malloc(). Gosh!
}
private:
struct MessageType message;
};