|
-
January 19th, 2006, 04:09 AM
#16
Re: Is this valid initialize of char []
Thanks, but I tried to init den as following, and I changed the arguments type of const_str1 & const_str2 to const char*
const char* dent[] = {const_str1, const_str2};
the compiler reports (sorry not to give the compiler type, it is cc in HP Unix server):
cc: error 1521: Incorrect initialization.
-
January 19th, 2006, 05:16 AM
#17
Re: Is this valid initialize of char []
 Originally Posted by sandodo
Code:
char const_str[] = "a test";
char* dent[] = {const_str};
The problem is that const_str1, const_str2 are passed into the function as char* type arguments.
That's not a problem. A function with formal parameter of type pointer can always take a compatibly typed array as an actual parameter.
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
|