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
How can a user view the options for Junk E-mail?
alexdok [17]
B. by right clicking all messages in the junk email folder
8 0
3 years ago
Read 2 more answers
Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual. Wh
777dan777 [17]
There might be insufficient storage space so your computer usually takes a longer time to load.The bigger your file, the longer it takes to load. So the solution is to clear up your storage space



7 0
3 years ago
If your computer won't connect to the internet, which of these is most likely to be the problem?
Setler79 [48]

Answer: just like rtyguj said, RAM, ROM, and O USB are all built into your computer so it would be onic

8 0
3 years ago
"In a(n) _____ file, each alphabetic, numeric, or special character is represented with a 7-bit binary number."
natita [175]

Answer:

ASCII is the correct answer for the above question.

Explanation:

  • ASCII is used to encode any character which is understood and used by the computer system.
  • It is also known as the American standard code for information interchange. It is used to represent any character in the form of 7 bit-binary number which can be used for the computer system.
  • It is designed for computers. It is in the binary language because the computer can understand only binary language.
  • The above question asked about the file which holds the special character and presented in the form of binary. This file is known as the ASCII file which is described above.
4 0
3 years ago
What does a mother board in a computer do?
IRINA_888 [86]

The motherboard is the central component of a computer. Without it, the computer would not work. The mother board is sometimes called "the heart of the computer" because it allows thinks to function properly.

The motherboard of the computer is the part that holds the system memory and audio. It's a printed circuit board.

4 0
3 years ago
Other questions:
  • Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
    9·1 answer
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • hard disk drive has 16 platters, 8192 cylinders, and 256 4KB sectors per track. The storage capacity of this disk drive is at mo
    13·1 answer
  • What are the benefits of maintaining your vehicle?
    5·2 answers
  • Which of the following about Java arrays is true?
    14·1 answer
  • Which of the following contains hardware systems similar to the affected organization but does not host live data?
    13·1 answer
  • 2ND LAST QUESTION
    13·1 answer
  • A malicious user in your organization was able to use the Trinity Rescue Kit to change the password on a department manager's co
    7·1 answer
  • Sự ra đời của thương mại điện tử có tác động như thế nào đến việc quảng cáo và Marketing sản phẩm
    11·2 answers
  • X = 9 % 2<br><br> if (x == 1):<br>   print ("ONE")<br> else:<br>   print ("TWO")
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!