Answer where it says your code goes hereImplement the int fi.docx - *Answer where it says\"your code goes here Implement the int findchar(char str int

Answer where it says your code goes hereImplement the int fi.docx

This preview shows page 2 - 4 out of 5 pages.

****Answer where it says "your code goes here"Implement the int findchar(char str[], int size, int start, char ch) function.It has four input parameters:str: an input string, size: the length of str,start: a ���starting position ie an index between 0 and (size -1), ch: a single characterGiven the inputs this function searches the character ch in thesubstring of str which starts from the index position specifiedby start and goes all the way to the end of str. if start is 0, then the entire string will be searched. NOte that, the character being searched may appear multiple times in the (sub) string, and the function returns the index of the first appearance of the searched character. if the character is not found, the function should return -1.#include <stdio.h>#include <string.h>/* Define a Passenger struct */typedef struct {char class[10];���char age[10];���char gender[10];���char survived[10];���} Passenger;/* Print the information of a Passenger */
Background image
void printInfo(Passenger p) {�����
Background image
Image of page 4

You've reached the end of your free preview.

Want to read all 5 pages?

  • Fall '19
  • Character encoding, ASCII, #include, len

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture