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
Please help!
LekaFEV [45]
The answer to the addition problem is 859.98
6 0
3 years ago
What are the 4-bit patterns used to represent each of the characters in the string "1301"? Only represent the characters between
Alla [95]

Explanation:

The string "1301" can be converted into numbers by using the ASCII characters set.

1. Decimal ASCII

1=49, 3=51, 0=48, 1=49

Without space

"1301" = 49 51 48 49

with space included

"1 3 0 1" = 49 32 51 32 48 32 49

(white space is represented by 32 in Decimal ASCII)

2. Hexadecimal ASCII

1=31, 3=33, 0=30, 1=31

Without space

"1301" = 31 33 30 31

with space included

"1 3 0 1"= 31 20 33 20 30 20 31

(white space is represented by 20 in hexadecimal ASCII)

The magnitude can be found by traditional decimal to binary conversion (Divide by 2 until we are left with remainder 0 or 1) and sign can be represented by adding most significant bit (MSB) 0 for positive and 1 for negative.

A. -27

Magnitude: 00011011

Since the sign is negative add 1 to the MSB

which becomes 100011011

B. 140

Magnitude: 10001100

Since the sign is positive add 0 to the MSB

which becomes 010001100

C. -99

Magnitude: 01100011

Since the sign is negative add 1 to the MSB

which becomes 101100011

D. 46

Magnitude: 00101110

Since the sign is positive add 0 to the MSB

which becomes 000101110

7 0
3 years ago
Taking notes on a customer complaint is a form of a communication<br> TRUE OR FLASE
almond37 [142]
True because you are seeing the tone and listening to the reasons why they are making the complaint. and your communication to the customer.
3 0
3 years ago
____ is a very fast network media. It contains multiple (sometimes several hundred) clear glass or plastic fibers, each about th
nikitadnepr [17]

<u>Fiber optic cable (FOC</u>) is a very fast network media and it comprises multiple clear glass or plastic fibers.

<h3>What is a fiber optic cable?</h3>

A fiber optic cable can be defined as a type of wired connector which are either made of glass or plastic and they are typically used for connecting one network device to another, so as to form a computer network and enable the continuous transmission of data between them.

In Computer technology, fiber optic cables (FOCs) are commonly produced through the use of several concentric layers of transparent material such as glass or plastic, with each having a slightly different index of refraction for light waves and about the thickness of a human hair.

Read more on fiberoptic cables here: brainly.com/question/116766

8 0
2 years ago
Which of the following best describes a hacktivist? Select one: a. An individual who attempts to destroy the infrastructure comp
brilliants [131]

Answer: (B) An individual who hacks computers or Web sites in an attempt to promote a political ideology

Explanation:

 Hacktivist is the defined as an individual that basically hacks the various types of web sites and computer system for promoting the various political ideologies. The hacktivists is the method which include the DDOS attacks (Distributed denial of services).

It basically causes various website and the email with the congestion of traffic with the computer virus and by the data stealing. The denial of services attacks typically considered federal crime and illegal in united state.  

4 0
4 years ago
Other questions:
  • Question 1 : Which statement is true about interlaced images? This task contains the radio buttons and checkboxes for options. T
    8·1 answer
  • In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?
    6·1 answer
  • The number of protons plus the number of nuetrons equal the <br> A.atomic weight<br> B.atomic number
    10·1 answer
  • Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the pop
    7·1 answer
  • Print person1's kids, apply the IncNumKids() function, and print again, outputting text as below. End each line with a newline.
    12·1 answer
  • Should you configure if you want to limit access to files with certain classifications within a folder to a specific security gr
    13·1 answer
  • True or False: A function with no parameters or extern vars can only return a
    8·1 answer
  • customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft Pow
    5·1 answer
  • What is collaboration
    14·1 answer
  • Help me to solve please​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!