Thread: static character pointer within a function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    85

    Question 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;
    
    };
    Last edited by dv007; 02-09-2006 at 11:49 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 04-04-2009, 03:45 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM