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
sineoko [7]
3 years ago
15

Mix ‘em Let s1 and s2 be 2 c-strings of the same length. Write a function char* mixem(char*s1, char* s2) which returns a c-strin

g made up of the characters of s1 and s2 "interleaved", starting with the first character of s1. Example: S1="abc", s2="123" The call mixem(s1,s2) returns the c-string "a1b2c3" Note: If s is a c-string, strlen(s) returns the length of the string (not counting the terminating null character ‘\0’.) Every c-string has a null character at the end.
Computers and Technology
1 answer:
Shkiper50 [21]3 years ago
5 0

Answer:

See Explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace std;

char *mixem(char *s1, char *s2);

int main() {

cout << mixem("abc", "123") << endl;

cout << mixem("def", "456") << endl;

return 0;

}

char *mixem(char *s1, char *s2) {

char *result = new char[1 + strlen(s1) + strlen(s2)];

char *p1 = s1;

char *p2 = s2;

char *p = result;

while (*p1 || *p2) {

if (*p1) {

*p = *p1;

p1++;

p++;

}

if (*p2) {

*p = *p2;

p2++;

p++;

}

}

*p = '\0';

return result;

}

You might be interested in
Which of the following best meets the requirements of a strong password?
Hoochie [10]

Answer:

having a capital and lower case letters and a special characters and numbers.

Explanation:

it should be hard but easy enough to remember and no one will know

6 0
3 years ago
Read 2 more answers
You are a very small company that sells healthcare insurance plans. You estimate that the breach of your customer database will
lozanna [386]

Answer:

C. Accept the risk

Explanation:

The first option is close but might not be suitable for a small company considering it's cost.

The second option which is to spend fifty thousand dollars per year on a data loss prevention solution is projected to cost you more than the risk.

The third option isn't specific and lacks a course of action.

6 0
3 years ago
This is due in like an hour but I'm confused so please do lend assistance
blagie [28]
Yes you do have to program it first.
4 0
3 years ago
Laurel, the manager of a software company, assumes that the male employees in his organization are more creative and innovative
grandymaker [24]

Answer:

Sterotyping

Explanation:

A stereotype is an over-generalized perception or view about a particular category of individuals or group. It is a belief that people might have concerning each and every person of a particular group. The type of expectation can differ from people to people; it can be, for instance, a belief or perception about a particular group's personality, preferences, or ability.

5 0
3 years ago
What is the different between the simple statement and compound statement ?​
OverLord2011 [107]

Answer:

Following is the difference between Simple and Compound statement; Simple statement (sentence) is one which has only one subject and one predicate. A Compound statement (sentence) is one which has two or more independent clauses consisting of their own subject and predicate.

Explanation:

hope it helps you

Mark as brainliest.

And follow for a follow back

4 0
3 years ago
Other questions:
  • Gabriel needs to create a formula that does not change when it is copied to cell b2. which formula should he create?
    14·1 answer
  • Write the definition of a method, oddsMatchEvens, whose two parameters are arrays of integers of equal size. The size of each ar
    10·1 answer
  • Communication is defined as__________.
    10·1 answer
  • The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
    15·1 answer
  • Technician A says that a system should be recharged with refrigerant until the condenser temperature is equal to the ambient tem
    9·1 answer
  • What is the function of ctrl+Q​
    14·1 answer
  • The table button is present in the ……… tab.​
    14·2 answers
  • Another one please help quick i got to go soon
    7·1 answer
  • Jade has to create a workbook for storing information of students participating in the annual state-level sports competition. Th
    5·1 answer
  • What happens when you create a variable in a video game program?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!