Question: Using C write a function, halfstring, which creates a new string which skips every second characters of the first string. For example: John Smith would

Using C write a function, halfstring, which creates a new string which skips every second characters of the first string.

For example: "John Smith" would become "Jh mt"

The function prototype must be:

void halfstring(const char [ ], char [ ]);

Think how you will use the two parameters.

As a result, you will have both the resulted string and the original one.

Do not use ANY system-defined string functions (i.e. those found in the string.h library including but not limited to strlen, strcat, and strcpy.).

Write driver code to test your function.

As we discussed in the class, your program and output must be self-explanatory.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!