|
-
April 15th, 2007, 05:30 PM
#4
Re: Arrays of Strings- stumbling over a very basic question
Urrggghhhh! delete[], of course! I knew it was something basic. So that answers question 1 & 3. As far as 2 goes, I'm pretty sure a declaration like
is legal, but when I declare the string this way, then do the assignment
Code:
addrs= new string[NumAddrs];
I get a compiler error. In fact, the error
error: incompatible types in assignment of 'std::string*' to 'std::string [0u]
says the compiler even knows it's a * to [] assignment. In other words, it likes it declared as a * but not as a [], even though I'm assigning a [] to it.
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
|