So I've been working on a program that takes a string and then puts it in an i * 6 char array but I can't seem to get it to work, any help with the problem would be much appreciated.
Here is the unsatisfactory code I have so far:
#define WIDTH 6
#include <iostream>
#include <string>
using namespace std;
int i,n,m;
int main ()
{
string r = "abcdefghijklmnopqrstuvwx";
if (r.length() <= 36 && r.length () >= 31 ){
char array [] = {r[0],r[6],r[12],r[18],r[24],r[30],r[1],r[7],r[13],r[19],r[25],r[31],r[2],r[8],r[14],r[20],r[26],r[32],r[3],r[9],r[15],r[21],r[27],r[33],r[4],r[10],r[16],r[22],r[28],r[34],r[5],r[11],r[17],r[23],r[29],r[35]};
cout << array << "\n";
}
if (r.length() <= 30 && r.length () >= 25 ){
char array [] = {r[0],r[6],r[12],r[18],r[24],r[1],r[7],r[13],r[19],r[25],r[2],r[8],r[14],r[20],r[26],r[3],r[9],r[15],r[21],r[27],r[4],r[10],r[16],r[22],r[28],r[5],r[11],r[17],r[23],r[29]};
cout << array << "\n";
}
if (r.length() <= 24 && r.length () >= 19 ){
char array [] = {r[0],r[6],r[12],r[18],r[1],r[7],r[13],r[19],r[2],r[8],r[14],r[20],r[3],r[9],r[15],r[21],r[4],r[10],r[16],r[22],r[5],r[11],r[17],r[23]};
cout << array << "\n";
}
if (r.length() <= 18 && r.length () >= 13 ){
char array [] = {r[0],r[6],r[12],r[1],r[7],r[13],r[2],r[8],r[14],r[3],r[9],r[15],r[4],r[10],r[16],r[5],r[11],r[17]};
cout << array << "\n";
}
if (r.length() <= 12 && r.length () >= 7 ){
char array [] = {r[0],r[6],r[1],r[7],r[2],r[8],r[3],r[9],r[4],r[10],r[5],r[11]};
cout << array << "\n";
}
system ("pause");
return 0;
}