easy to understand
ReplyGood stuff about the vectors with arrays and etc..Reply
Simple examples (like those provided for reserve) that clear questions regarding implementation of the same! Thanks, Gabriel. :)
ReplyI think it is a great article for beginning in STL. I am somehow never used it, as I thought it was too complicated to understand, and used regular arrays (!) to do my work. Thanks to the author, he made it easy to explain it.
ReplyHere is some constructive feedback:
The default font size is kind of small. This would not be so bad if it were not for the fact that it is a static size. I cannot increase the font size without changing my monitor's resolution.
The text that states: "Do not use a macro! ... very poor style!" should explain why, as it leaves people wondering. Here is an article explaining why defining macros are 'evil':
C++ Faq Lite
This is a very good article. I wish I had found it when I first started learning STL.
In your code you show try catch block where you used catch of exception by value, this is a bad proctice for 2 reasons: 1. you may have to catch polymorphicly!! 2. you don't want to actualy create the object that was thrown (some of them may not handle copying so nicly because the writer assume that you catch by ref) other then that good artical :)
ReplyOriginally posted by: kandukondein
Good Article...got a grasp of some things which we usually neglect
ReplyOriginally posted by: SaiPrabhu
This Article is very nice and easily to understand.I have one doubt can we create double dimension vector array.
Hi,
Thanks and regards.
Sai
SaiPrabhu, yes, you can. Take a look at the following article in the Visual C++ FAQ: STL: How to declare and use two-dimensional arrays?
ReplyOriginally posted by: Michael T. Babcock
class name_list(std::vector<std::string>)
Its a silly example, but many of my C++ projects contain such classes that are extensions of lists with type-specific functions added because once you've defined the class (the way you'd typedef it normally), you know what you're dealing with (strings in this case).
If you want to have some good fun with vectors, remember that you can create a class based on one:
{
public:
append(const char *s)
{
std::string str(s);
push_back(str);
}
}
Originally posted by: Oliver
Well done! I believe this article is very useful for many beginners. Thank you.
Oliver.
(could not see the last comment to be the recent one ;)