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
Round 74,361 to the nearest 10​
grandymaker [24]

Answer:

74,400 i think

Explanation:

8 0
3 years ago
What is radial gradient in Flash CS3
djverab [1.8K]

Answer:

Radial gradients radiate from a center focal point. Both can be edited for color, alpha, and position within a fill or stroke. You can add up to 16 colors to a gradient, precisely control the location of the gradient focal point, and apply other parameters. A gradient behaves like any other fill or stroke.

8 0
3 years ago
What is a trojan horse in computer science?
Firdavs [7]

Answer:

type of malware that is often disguised as legitimate software. Trojans can be employed by cyber-thieves and hackers trying to gain access to users' systems. Users are typically tricked by some form of social engineering into loading and executing Trojans on their systems.

Explanation its malware

4 0
3 years ago
_______ refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when
ludmilkaskok [199]

Geofencing Marketing refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when a mobile device enters or leaves a particular area.

<h3>What is Geofencing Marketing?</h3>
  • Geofencing marketing is an illustration of a real-time location-based trade tactic that utilizes geolocation data to mark users within a specified geographic region and delivers a range based on where they are or in what areas they have previously visited.
  • Geofencing marketing concerns setting up virtual borders around a point or area that tracks whenever someone with a portable device crosses them.

To learn more about Geofencing Marketing, refer:

brainly.com/question/9795929

#SPJ4

4 0
2 years ago
Match the data type to the given data.
guapka [62]
Float: 26.2
Array: c, o, m, p, u, t, er
Boolean: false
Character: c
7 0
3 years ago
Other questions:
  • As a final lesson to her team, Katie shows them a job that has already been preflighted and is now getting ready to be sent to t
    7·1 answer
  • Due to the absorption and scattering of shorter wavelengths by interstellar dust, distant stars appear A) bluer. B) brighter. C)
    9·1 answer
  • Explain Cascading Style Sheets and what they do. Describe their primary function, two effects that this function has on programm
    11·1 answer
  • Which feature is an interface between the user and the file system of a computer?
    6·2 answers
  • What pressure will be shown on the high side peessure gauge (ac system on)
    12·1 answer
  • When you check to see how much RAM, or temporary storage you have available, you are checking your _____.
    7·1 answer
  • Please help me with opinions, ideas, any websites that would help, or chart, article, video, or podcast to help support your pos
    10·1 answer
  • How many transponders are contained within a typical satellite?
    12·1 answer
  • A prime number is an integer that is divisible only by 1 and by itself. Write a program that: 1. Takes a number as an input. 2.
    5·1 answer
  • Cuantos MB son 8,192 kb?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!