|
-
April 26th, 2007, 05:22 AM
#8
Re: CStrings Question: What is the difference between char str[] and char* str
Hi all.
In addition what Cilu said, char[] defines an array of char initialized with a string literal and closed by the '\0', the special character that ends the strings;
When you call ucase with char[], the function strlen finds the '\0' and all works fine; instead, when you call ucase with char* strlen don't find the '\0' so your program crashes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|