13 years, 6 months ago
Highlights
Community contributions featuredIf you use the raw pointer solution SiCrane posted, don't forget to delete the pointer in the new bullet maker and after the end of the program so you won't leak memory! …
13 years, 6 months ago
13 years, 6 months ago
As has been said, use std::vector::back() or vec[vec.size()-1], but ALWAYS check if the vector is not empty. Using either of those without checking for non-emptiness results in…
13 years, 6 months ago
13 years, 6 months ago
It can be done quite easily. There are many uses of this technique, e.g. packets. When retrieving those data, bit AND them by the bits you want to retrieve and right shift them…
13 years, 6 months ago
Latest Activity
See all in DiscussionsIf you use the raw pointer solution SiCrane posted, don't forget to delete the pointer in the new bullet maker …
13 years, 6 months ago
As has been said, use std::vector::back() or vec[vec.size()-1], but ALWAYS check if the vector is not empty. Using either of …
13 years, 6 months ago
It can be done quite easily. There are many uses of this technique, e.g. packets. When retrieving those data, bit …
13 years, 6 months ago