What do you want to save?
Add Code snippet
New code examples in category C++
-
Sallivana 2021-08-30 23:29:01
sfml mouse click
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) { // left click... } // get global mouse position sf::Vector2i position = sf::Mouse::getPosition(); // set mouse position relative to a window sf::Mouse::setPosition(sf::Vector2i(100, 200), window); Add solution -
The Stranger 2021-08-30 14:57:01
c++ find object in vector by attribute
std::vector<Type> v = ....; std::string myString = ....; auto it = find_if(v.begin(), v.end(), [&myString](const Type& obj) {return obj.getName() == myString;}) if (it != v.end()) { // found element. it is an iterator to the first matchin... Add solution
Best helpers
Skout
+5
Chd
+5
Mark Walsh
+5
Dasedes
+5
JCM
+5
Lim
+5
TheBeege
+5
Bryce Wagner
+5
Sg qy
+5
NullPointer
+5