• Register
search
Log In
0 votes
150 views

Problem :

Looking for solution on bellow problem
assign searchresult with a pointer to any instance of searchchar in personname. hint: use strchr().
6.9k points

1 Answer

0 votes

Solution :

The strchr() function is used to find the first occurrence of a specified character in a string. 
The Syntax is char *strchr(char *str, int ch); 
The function strchr() searches str from left side to right side until the character ch is found or the terminating NULL character is found. 
If ch is found, a pointer to it is returned. 
If not, NULL is returned.

Further Readings:

36.1k points

Related questions

0 votes
2 answers 124 views
124 views
Problem : I am very new to PHP and MySQL and I just can't figure this one out. I have searched on all around the forums but haven't found the answer I can make sense of. I originally was using mysql_fetch_assoc() but I could only search numbers and ... Thank you in advance for all of your help! My Error : “Mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in”
asked Jan 18 jwilliam 3.9k points
0 votes
1 answer 618 views
618 views
Problems : Assign the size of userInput to stringSize. Ex: if userInput = "Hello", output is: Size of userInput: 5 #include <stdio.h> #include <string.h> int main(void) { char userInputArray[50] = ""; int stringInputSize = 0; strcpy(userInputArray, "Hello"); /* Your solution starts here */ printf("Size of userInputArray: %d\n", stringInputSize); return 0; }
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 587 views
587 views
Problem : I am very new to C++ and trying to learning C++ template. Please find below my code, I am trying to define a template class and also want to call the member function in the main() method.. template <typename T> class Calculate { T _x; T ... the last line of above code : Expression preceding parentheses of apparent call must have (pointer-to-) function type How can I resolve this issue?
asked Dec 3, 2019 alecxe 7.5k points
0 votes
2 answers 778 views
778 views
Problem : I got following rather cryptic error message: the truth value of an array with more than one element is ambiguous. use a.any() or a.all()
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
0 answers 8 views
8 views
Problem: I have recently started learning the C Programming. Currently I am trying to write C programs. In this coding problem I am trying to count the number of characters, newlines and number of words. But I think there is some issue in the second while loop which I am unable to ... ();                 nc++;             }             nc++;         }     }     printf("%d %d %d",nl,nc,nw); }
asked Jun 16 Raphael Pacheco 560 points