changed strchr_my_arr & strchr_my_ptr
This commit is contained in:
parent
a27f27d6f6
commit
4d01a02712
@ -68,7 +68,7 @@ char* strcat_my_ptr(char* destination, const char* source) {
|
|||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* strchr_my_arr(const char str[], int ch) {
|
char* strchr_my_arr(char str[], int ch) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (str[i] != '\0') {
|
while (str[i] != '\0') {
|
||||||
if (str[i] == (char)ch) {
|
if (str[i] == (char)ch) {
|
||||||
@ -79,7 +79,7 @@ char* strchr_my_arr(const char str[], int ch) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* strchr_my_ptr(const char* str, int ch) {
|
char* strchr_my_ptr(char* str, int ch) {
|
||||||
while (*str != '\0') {
|
while (*str != '\0') {
|
||||||
if (*str == (char)ch) {
|
if (*str == (char)ch) {
|
||||||
return str;
|
return str;
|
||||||
|
Loading…
Reference in New Issue
Block a user