std tag

3 questions


1 answers
70 views
0
How do I erase elements while writing std::list?

for (std::list<item*>::iterator i=items.begin();i!=items.end();i++){ bool isActive = (*i)->update(); //if (!isActive) // // items.remove(*i); //else other_code_involving(*i);}items.remove_...

1 years ago

1 answers
62 views
0
How do I find items in std::vector?

I want to find out if there's an element in the vectorHow do we figure it out?How can I create item_present in the code below? if ( item_present ) do_this();else do that();

1 years ago

1 answers
67 views
0
Why don't you use using namespace std?

Why don't you write using namespace std;?Like std::out, std::cin, std::cin, I don't know why.Is it inefficient? Or is it because the variables are at risk of blurring?Does it affect the performance of...

1 years ago

© 2024 OneMinuteCode. All rights reserved.