Question

24. Function searches for the first occurrence in its first string argument of any character in its second string argument. a
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer

strfirst is not a valid c function.
strstr finds the first occurrence of second string in the first string.
firstany is not a valid c function.
strpbrk finds the first occurrence of a character from the second string in the first string.

Answer: d.  strpbrk
Add a comment
Know the answer?
Add Answer to:
24. Function searches for the first occurrence in its first string argument of any character in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • write a function which takes a string argument and a character argument. It should return a...

    write a function which takes a string argument and a character argument. It should return a truth value (int 0 or 1), 0 if the string does not contain the character, and 1 if the string does contain the character. Do not use a built-in library for this. Again, call this function and its variables whatever you deem appropriate. The main function of the program should accept a single character followed by Enter. Then, it will read lines until the...

  • Write a function that accepts a pointer to a C-string as its argument. The function should...

    Write a function that accepts a pointer to a C-string as its argument. The function should count the number of times the character 'w’ occurs in the argument and return that number.

  • 2) Write a function stringManip that takes in a character string and returns a character string...

    2) Write a function stringManip that takes in a character string and returns a character string following these rules: a) any vowel (a, e, i, o, u) is replaced by the character '&' b) any numeric character has 1 added to it (if it was 9, it becomes O instead) (str2num() is useful here) c) all lowercase characters become uppercase d) replace the final character with '!' e) append the length of the string before this step to the end...

  • 1. Write a function called ordinal_sum that accepts a string argument and returns the sum of...

    1. Write a function called ordinal_sum that accepts a string argument and returns the sum of the ordinal values of each character in the string. The ordinal value of a character is its numeric Unicode code point in decimal. 2. Write code that creates a Python set containing each unique character in a string named my_string. For example, if the string is 'hello', the set would be {'h', 'e', 'l', 'o'} (in any order). Assign the set to a variable...

  • Create the function front33 that accepts a string as an argument. The first three letters of...

    Create the function front33 that accepts a string as an argument. The first three letters of the string are added to the front of the string and at the end of the string. If the string length is less than 3, use whatever chars are present. The function takes a string character and returns a new string taking the first three characters of the input string and adding them to the front and the back of the string. (must be...

  • string to_binary(char c) returns 5 bit string that is the index of the character argument. if...

    string to_binary(char c) returns 5 bit string that is the index of the character argument. if the provided character is not a lower-case alphabetic character, return the empty string. ---------------------------------------------------------- char from_binary(string bit_str) returns the character that the 5 bit binary string bit_str represents. if any of the following conditions are not true:  the size of bit_str is 5  every element of bit_str must be a ‘1’ or a ‘0’  the character produced must be a lower...

  • Write a program with a function that accepts a string as an argument and returns a...

    Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is “hello. my name is Joe. what is your name?” the function should return the string “Hello. My name is Joe. What is your name?” The program should let the user enter a string and then pass it to the function. The modified string should be displayed.

  • 1.) Write a recursive function named isPalindrome that will take a single string as an argument...

    1.) Write a recursive function named isPalindrome that will take a single string as an argument and determine if the argument is a palindrome. The function must return True if the argument is a palindrome, False otherwise. Recall that any string is a palindrome if its first and last characters are the same and the rest of it is also a palindrome (therefore, a single character is a palindrome): 2.) Consider a text file named samplestrings.txt that contains a collection...

  • Write and test a function toDecimal() that converts a roman number such as MCMLXXVII to its...

    Write and test a function toDecimal() that converts a roman number such as MCMLXXVII to its decimal number representation. Write a main program to test the function. Your function should have two arguments - the roman number as a string, and an error processing function. Write a helper function that will return the numeric value of each of the letters used in roman numbers. Then convert the string argument as follows look at the first two characters. If the first...

  • Write a function that would accept a string and checks if any character is repeated more...

    Write a function that would accept a string and checks if any character is repeated more than once. The function would return the repeated chars and the number of times they are repeated. The return value is a string, all pairs separated by a comma. E.G. function(“2abc**zac22”); returns: 2=3,a=2,c=2,*=2

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT