char string 
Author Message
 char string

Hi
I have a question regarding char strings.
If I do not do malloc for a string but just declare it as,
say : char str[20];
when the program exits, the string will automatically be
lost right? Hence it will not cause memory leaks.  Am I
right? Just need some confirmation on this.
Thanks!


Sun, 27 Mar 2005 10:34:17 GMT  
 char string

Quote:

> Hi
> I have a question regarding char strings.
> If I do not do malloc for a string but just declare it as,
> say : char str[20];
> when the program exits, the string will automatically be
> lost right? Hence it will not cause memory leaks.  Am I
> right? Just need some confirmation on this.
> Thanks!

Right.  malloc/free work like a lending library.  Don't try to check in
a book you didn't check out from that library!

--
Scott McPhillips [VC++ MVP]



Sun, 27 Mar 2005 11:19:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. char * to wchar_t (char string to wide string)

2. char arrays versus char strings.

3. Conversion char/string/unsigned char?

4. Converting a char string into a wchar string.

5. Adding char string values

6. newbie question about char strings

7. Passing an array of char strings by descriptor

8. Char / String

9. int ,char,string

10. problem with scanf formatter for char strings

11. strupr(char *string)

12. problems with:char strings/arrays

 

 
Powered by phpBB® Forum Software