18 lines
364 B
C++
18 lines
364 B
C++
//#include <string.h>
|
|
//#include <algorithm>
|
|
|
|
int findChar(char* str, char targetChar)
|
|
{
|
|
for(int i = 0; str[i] != '\0'; i++) {
|
|
if(str[i] == targetChar) return i;
|
|
}
|
|
}
|
|
|
|
/*
|
|
int getPosition(const char *array, size_t size, char c)
|
|
{
|
|
const char* end = array + size;
|
|
const char* match = std::find(array, end, c);
|
|
return (end == match)? -1 : (match-array);
|
|
}
|
|
*/
|