   C++ Char* pointer question
  Hi, I''ve been programming C++ a few years and know the language faily well, but I not sure about one thing. When I make and store text strings using char*''s i do this:char* text = "Hello World";  Is that the right way to do that? I thought so up untill a while back when someone said something about the way I was doing it. Am I ment to dynamicly allocate and delete memory for it from the heap? If so why, because using things like printf(), it seems to be OK.Its probably nothing, I''m just fine tuning my knowlege with pointers here, its just the char* thats done it. I say that becasue you usaly assign them an address, not a string or a normal number.Thanks,-J    _____________________________________________:S Confused? Me too! :S  
  I don''t see how that would be a problem as youa re reserving the memory at compile-time (?)  So no memory has to be dynamically allocated and thus you don''t need to worry about deleting thememory or memory leaks.all you''re essentially doing is creating a character array without specifying the number or characters in the array.Does that make sense?commando_337"I have to stop questioning myself"  ;  I remember asking a similar question a while back. I think most people would have donechar text[] =  "Hello World";instead of what you did as it is the standard way in lessons and books etc. But what you did doesn''t make any difference since char* and char[] are basically the same thing (in a way).You only need to ''delete'' if you used ''new''  ;  Actually, the correct way to do this is:const char* text = "Hello world";  And, Andy, char* and char[] aren''t the same (you can''t reassign a char[], sizeof report different sizes, you might not be able to change a string pointed to by a char*, and the way they''re represented in memory is different).