452,208 views
3 votes
3 votes
5. Write a function named “hasTwoQuestionMarks” that accepts parameters of the same as command-line arguments ( argc and argv ). It returns true if one of the arguments has a “??” character and false otherwise. If it has no argument, it will return false.

Once the “??” characters are found, please do not continue to the search.

Please note that you cannot use string class, string methods or any string function such as strlen. Please use only array notation, pointer to character, and/or pointer arithmetic and make use of the fact that this is a C-string.

Please write the main program that accepts argc and argv and pass them to this function and print out its result.

For example, if the arguments are“??two”,“one two??“ or “one t??o” it will return true and if it is“", “?”, “/?”or “one tw?o?”, it will return false.

User AzzamAziz
by
2.6k points

1 Answer

20 votes
20 votes
Hope this helps. Thanks.
5. Write a function named “hasTwoQuestionMarks” that accepts parameters of the same-example-1
User Farhood ET
by
2.7k points