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
Sloan [31]
3 years ago
5

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 firstOfAny().
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 any character inside str2.
Return a pointer to the first character in str1 where this occurs.
Note that if no characters from str2 appear in str1, the pointer will point to the NUL character at the end of str1.
Computers and Technology
1 answer:
Radda [10]3 years ago
7 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
Francis has designed a picture book appropriate for third graders. He wants teachers across the world to freely download use, an
mestny [16]

Answer:

The correct answer will be "Project Gutenberg".

Explanation:

  • Project Gutenberg continues to obtain lots of requests for authorization for using printed books, pictures, as well as derivatives from eBooks. Perhaps some applications should not be produced, because authorization would be included in the objects provided (as well as for professional usages).
  • You can copy, hand it over, or m actually-use it underneath the provisions including its license that was included in the ebook.

So that the above is the right answer.

8 0
3 years ago
Which three are characteristics of flow
miskamm [114]

Answer:

concentration on the task

clarity of goals

reward in mind

immediate feedback

Explanation:

3 0
3 years ago
When reading words using a Scanner object's next method, _________. a. any characters at the beginning of the input that are con
zavuch27 [327]

Answer:

The answer is "Option d"

Explanation:

The scanner method is the full token of the process, that finds and returns. It is token, which is followed by both the inputs meeting and the guideline template. This method can block, even though the former instance of hasNext() is true while waiting for input, and wrong choices can be described as follows:

  • In option a, It is incorrect because the character at the beginning can't be considered.
  • In option b, It is wrong because the characters are known as the word in which blank space not a part of the word.
  • In option c, It is wrong because in this input before the call is not the method.
3 0
3 years ago
Repayment of a direct plus loan begins:
just olya [345]
The answer is D I hope i'm right


4 0
4 years ago
Read 2 more answers
Software (often on firmware) designed to make physical products and devices smarter by doing things like sharing usage informati
Katarina [22]

Answer:

Embedded System

Explanation:

Embedded System are designed to make physical products and devices and helping in diagnose problems as well.

3 0
3 years ago
Other questions:
  • Describe the objectives of e-commerce?​
    13·1 answer
  • Type dig www.example A in order to get the IP address of www.example. What’s the TTL of the A record returned in the response? W
    9·1 answer
  • Which data table display compares report metrics to the website average?
    6·1 answer
  • Write a program to read customer number, Name, loan amount, interest rate and time of repayment. Calculate and display the EMI .
    9·1 answer
  • I need help in creating a Java Program; To calculate the chapter from which you solve the programming exercise, below are the re
    7·1 answer
  • The first thing you should select if you're using an Address Block or Greeting Line is
    11·1 answer
  • Identify the two top benefits of using angel investors to start a business.
    6·1 answer
  • 2.
    9·1 answer
  • An embedded system describes computing technology that has been enclosed in protective shielding for security reasons. True or f
    12·1 answer
  • A(n) _____ is a data validation rule that should be applied to mandatory data items.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!