Computer Science, asked by gsgsgsgshhhh8500, 11 months ago

Write the prototype of a function 'search'which takes 2 arguments,a string and a character and returns an integer value

Answers

Answered by ArchitPathak
17

int search(string s , char c)

Answered by AskewTronics
3

The prototype of the function for the above problem in c++ language is as follows:

Explanation:

int search(string, char); // prototype of a search function, which takes one string argument and one-character argument and returned the value which is an integer type.

  • The prototype is used to tell the compiler about the name, type and the signature of the user-defined function.
  • It is necessary when the function definition is after the main() function of the calling function. It is because the compiler can not understand the meaning of the function if the definition of the function is after the calling statement.
  • When a user wants to create a prototype, then he needs to give the name of the function with the return type and define the argument type in the argument brackets as shown above.

Learn More:

  • Prototype in c++ : https://brainly.in/question/7108752

Similar questions