I am trying to copy a string into string variable "cpy" via a string pointer "seq" , my stub code -
#include <iostream>
#include<string.h>
using namespace std;
int main(){
string *seq[5],str[5],cpy;
for(int i=4;i>=0;i--)
{
cin>>str[i];
seq[i]=&str[i];
}
for(int i=0;i<5;i++)
{
//copy *seq[i] to cpy so that cout gives string str[i];
cout<<cpy<<endl; // print all strings according to new order
}
}
how do I accomplish this task?