• Register
0 votes

Problem :

Looking for solution on bellow problem
assign searchresult with a pointer to any instance of searchchar in personname. hint: use strchr().
6 5 3
6,930 points

Please log in or register to answer this question.

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:

9 7 4
38,600 points

Related questions

0 votes
1 answer 133 views
In C-check if char is in char array I am trying to check if a character belongs to a list/array of invalid characters. It comes from a Python background.) for c in string:      if c in invalid_characters:          #do stuff, etc How can I do it with a regular C character array?
asked Aug 27, 2020 sasha 16.2k points
0 votes
1 answer 11 views
let's imagine we have two classes A and B: from class A in private I create a vector of pointers to instances of B vector <B *> punt; How would you add pointers to instances of B in that vector? How would those pointers be removed from the vector? Like a normal ... (name); // assuming you have a constructor that assigns the name     punt.push_back (newB); ??? Thank you very much and greetings !
asked Aug 14, 2020 game 4.6k points
0 votes
1 answer 29 views
Problem Hello Kodlogs, I am working on creating a simple search with php but so far no success. I have tried code snippets on internet but they are not complete. They available code only shows how to troubleshoot. I am looking for complete code including PHP. HTML and CSS. Can you help?
asked Oct 30, 2020 hashq 1.1k points
0 votes
1 answer 7 views
PROBLEM : Is there anyone to helo on > 'how to find the value of x in a circle' ?
asked Mar 16 Samiur1 38.4k points
0 votes
1 answer 2 views
Problem: Linux count occurrences of string in file.
asked 6 days ago charles mathews 5.5k points
0 votes
1 answer 5 views
Problem: How would you go about testing all possible combinations of additions from a given set N of numbers so they add up to a given final number? A brief example: Set of numbers to add: N = {1,5,22,15,0,...} Desired result: 12345
asked Mar 10 ummesalma 25.2k points
0 votes
1 answer 6 views
Problem: I am stuck during learning as I have already mentioned in my question someone please cooperate me to continue my project-Thanks
asked Mar 21 shamimkhan 15.1k points
0 votes
1 answer 3 views
Problem: I am stuck with this ... Please help me that how to find a word in a cell in excel?
asked Mar 26 Ifra 24.4k points
0 votes
1 answer 155 views
Problem: I am wondering how can I determine the size of the array in some of the cases. I have written the below small sample program to illustrate what I am trying to say. int main(int argc, char *argv[]) {     std::vector<unsigned char>v;     unsigned char p[1024 ... return 0; } So I want to know the some or the other way to tell a vector how many elements it currently is supposed to be holding.
asked Jul 21, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 4 views
Problem: What is the use of pointer in c Can anyone tell me?
asked Apr 1 zayed1 35.6k points