|
-
July 31st, 2009, 06:46 AM
#11
Re: a project for beginner
 Originally Posted by laserlight
What is guaranteed is that std::vector<int>::size_type is an unsigned integer type but int is a signed integer type.
That's good to know. 
 Originally Posted by laserlight
Yes, except that the code example demonstrates casting from std::vector<int>::size_type back to std::vector<int>::size_type. Your intention would be to cast to int:
Code:
for (int i(0); i < static_cast<int>(intvec.size()); ++i)
{
intvec[i] = i;
}
Whoops
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
|