Is there a C function to find the second occurrence of sub-string in string?
i.e. String – “213 File status 550 Access Denied. 550 Access Denied.”
This function would return “550 found twice”….
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
strstr. Sincestrstrreturns a pointer to the first occurrence of the needle, you can use the result to find the next occurrence.For example, to count occurrences of the string
"550":