Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

check if an element is in array c++

#include <algorithm>

std::array<int, 3> arr = {1,2,3} // your array here
if (std::find(std::begin(arr), std::end(arr), 3) != std::end(arr)) {
	// code here  
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #check #element #array
ADD COMMENT
Topic
Name
6+6 =