Is there any inbuilt function to find index of an element of an array in C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there any inbuilt function to find index of an element of an array in C?

30th May 2020, 12:28 PM
Hirunij
Hirunij - avatar
2 Answers
+ 2
As far as I know there isn't. In c++ there is the std::find function.
30th May 2020, 12:50 PM
Michi
Michi - avatar
+ 2
I would say using functions from standard libraries is good practice. You don't have to reinvent the wheel all the time, besides it results in shorter code (readability) and they are well optimized.
30th May 2020, 3:24 PM
Michi
Michi - avatar