Explore BrainMass
Share

# Shifts to store value of five character variables in circular

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

The function definition starts as follows:
void shift(char*p1,char*p2,char*p3,char*p4,char*p5)
{

https://brainmass.com/computer-science/algorithms/shifts-store-value-five-character-variables-circular-95151

#### Solution Preview

Dear Friend,

void shift(char* p1,char* p2,char* p3,char* p4 ,char* p5)
{
cout << ...

#### Solution Summary

Write a function that shifts the stored value of five character variables in a circular fashion

\$2.19

## Shift variables in a circular fashion

This needs to be in "C"

Write a function that shifts the stored value of five character variables in a circular fashion. Your function should work in the following way. Suspose that C1, C2, C3, C4, C5 are variables of type char, and suspose that the values of these variables are 'A', 'B', 'C', 'D', 'E', respectively.

The function call shift(&c1,&c2,&c3,&c4,&c5) should cause the variables C1, C2, C3, C4, C5 to have the values 'B', 'C', 'D', 'E', 'A', respectively.

The function definition starts as follows:

void shift(char *p1, char *p2, char *p3, char *p4, char *p5)
{

Test the function by calling it five times and printing out, in turn, BCDEA, CDEAB, DEABC, EABCD, and ABCDE.

****This needs to be in "C"*****

View Full Posting Details