1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
antoniya [11.8K]
3 years ago
8

Write the following function without using the C++ string class or any functions in the standard library, including strlen(). Yo

u may use pointers, pointer arithmetic or array notation.
Write the function first Of Any(). The function has two parameters (str1, str2), both pointers to the first character in a C-style string. You should be able to use literals for each argument. The function searches through str1, trying to find a match for the first character inside str1 that does NOT appear inside str2. Return the index of the first character in str1 that does not appear inside str2. Note that if all of the characters in str1 appear in str2, then return the length of the C-String s1. (This will happen automatically if you write function correctly.)
Computers and Technology
1 answer:
belka [17]3 years ago
6 0

Answer:

See explaination

Explanation:

#include<iostream>

using namespace std;

const char* firstOfAny(const char *str1,const char *str2){

const char *p=str1;

while((*p)!='\0'){

const char *q=str2;

while((*q)!='\0'){

if((*p)==(*q)){return p;}

q++;

}

p++;

}

return p;

}

int main(){

cout<<firstOfAny("ZZZZuker","aeiou");

cout<<endl;

cout<<firstOfAny("ZZZzyx","aeiou");

return 0;

}

You might be interested in
Use fuel with the _____________ rating recommended by your vehicle manufacturer. A ) Converter B) Emission C) Exhaust D) Octane
Free_Kalibri [48]
I would say the correct answer is "octane". It is important that you use the fuel with  the correct octane rating recommended by the manufacturer. Among the choices it is only octane that is used as a rating for fuels. Hope this helps.
7 0
3 years ago
Read 2 more answers
Mechanisms that can be used to rescue accident victims
stiks02 [169]

Answer:

Hydraulic rescue tools

6 0
2 years ago
How do you strike through text in excel?
Valentin [98]
In the font options there is a checkbox for strikethrough. Same dialog as word, only there is no button in the ribbon for it. You could customize that by creating a custom group if you want to.
6 0
4 years ago
Which of the following occupations is least likely to involve use of a computing device on a day-to-day basis?
aliya0001 [1]

Answer:

Janitorial duties

Explanation:

7 0
3 years ago
Hello brainly users can someone help me out with this question thanks!!!
slavikrds [6]

Answer:

a medical journal/study from a licenced doctor on a website with .org

Explanation:

most medical journals from licenced doctors have .org in the end and are trusted

6 0
3 years ago
Read 2 more answers
Other questions:
  • What seems to be the prevailing opinion about enterprise clouds?
    8·2 answers
  • How do you mark somebody the brainliest?
    14·2 answers
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    6·1 answer
  • While reviewing the Quick Access toolbar, Sarah notices that the Redo button is not there. This is because the Redo button only
    12·1 answer
  • Need help asap<br> give the correct answer!!
    15·2 answers
  • 1. What are the biggest password mistakes that people and companies make? How can you avoid those mistakes?
    11·1 answer
  • Device driver issues can come up if you . If this happens, .
    11·1 answer
  • Why computer is used in education sector<br>​
    7·2 answers
  • Consider the following method substringFound, which is intended to return true if a substring, key, is located at a specific ind
    14·1 answer
  • Which of the formulas below are valid? Select all that apply?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!