User Profile

Collapse

Profile Sidebar

Collapse
DearSam
DearSam
Last Activity: Sep 21 '07, 07:54 PM
Joined: Sep 15 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • DearSam
    replied to Memory allocation to a char *
    in C
    Yes Jos I agree and often I use the literals..that is the reason I want to know how and when the literals are cleaned up or they simply keep filling data segment??

    Thanks
    Sam
    See more | Go to post

    Leave a comment:


  • DearSam
    started a topic Memory allocation to a char *
    in C

    Memory allocation to a char *

    Hi,

    How is memory allocated handled in C++ in following case:

    int main ()
    {

    char * s = "Hello"; //line 1
    s= "World"; //line 2
    s = new char[10]; //line 3
    delete[] s; //line 4
    }

    After assigning "Hello" to s in first line when s is reassigned with "World"
    1....
    See more | Go to post
No activity results to display
Show More
Working...