“vector.find ()” Kode Jawaban

Menggunakan temukan di vektor c

#include <algorithm>
#include <vector>
vector<int> vec; 
//can have other data types instead of int but must same datatype as item 
std::find(vec.begin(), vec.end(), item) != vec.end()
Embarrassed Eland

vector.find ()

#include <algorithm>
#include <vector>

if ( std::find(vec.begin(), vec.end(), item) != vec.end() )
   do_this();
else
   do_that();
Cooperative Capuchin

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya