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 terms refers to the cells that contain values and labels to be graphed in the chart?.
quester [9]

There are cells in some charts. The terms that refers to the cells that contain values and labels to be graphed in the chart is source data.

<h3>What is the meaning of source data?</h3>

Source data is known to be a kind of raw data that is often known as an atomic data. They are data that has not been processed for any vital use to become Information.

In computer programming tech., source data or data source is known to be a kind of primary point or location from where data originates from. The data source is known as a database, a dataset, etc.

Learn more about source data from

brainly.com/question/10838478?source=archive

7 0
2 years ago
Which of the following operations are considered to be crucial tasks that should be performed before installing server roles and
Bas_tet [7]

Answer:

A. Static IP address have been configured.

Explanation:

A network is an interconnection of network devices for communication to occur. A network comprises of end devices and intermediate network devices.

End devices are the sources and destinations of data transmission, while intermediate devices are the devices that makes communication of data possible like routers and switches. Examples of end devices are servers and workstations (computers, smartphones etc.).

A server in a network is a device that provides special services to workstations or clients. The IP addresses of servers must be known, that is, a static IP address must be configured on a server. Examples of server protocols are DNS, TFTP, FTP, DHCP etc.

8 0
2 years ago
13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails".
serious [3.7K]

Answer: c

Explanation:

only reasonable answer

7 0
2 years ago
PLEASE HELP!!!!!! ASAP
NNADVOKAT [17]

Answer:

use a wizard or use a design view

Explanation:

i took the test

4 0
3 years ago
Read 2 more answers
Consists of forging the return address on an email so that the message appears to come from someone other than the actual sender
Pavlova-9 [17]

Answer:

C. Spoofing.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

Some examples of cyber attacks are phishing, zero-day exploits, denial of service, man in the middle, cryptojacking, malware, SQL injection, spoofing etc.

Spoofing can be defined as a type of cyber attack which typically involves the deceptive creation of packets from an unknown or false source (IP address), as though it is from a known and trusted source. Thus, spoofing is mainly used for the impersonation of computer systems on a network.

Basically, the computer of an attacker or a hacker assumes false internet address during a spoofing attack so as to gain an unauthorized access to a network.

4 0
3 years ago
Other questions:
  • Hub is used in Twisted pair Ethernet. True/False
    6·1 answer
  • You can execute three main types of linux commands. what are they?
    8·1 answer
  • You are given n sorted sequences each one containing n keys. You may assume n is a power of two. We want to merge them into one
    15·1 answer
  • Why is the answer B?
    6·1 answer
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w
    11·1 answer
  • How do you calculate the life span of patents?
    13·1 answer
  • How many 3 byte sequences contain at least five consecutive 0-bits
    7·1 answer
  • How does the use of blocking affect the external sorting algorithm, and how does it change the cost formula
    5·1 answer
  • How do I fix when it hits the second session it skips scanf.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!