Using strings: porting from FreeBasic

djsfantasi:
It compiles and simulates fine.

My understanding is that it is an array of pointers to character arrays. Not an array of arrays. Subtle difference, but what fit my requirements.

In your example, the program compiles but blows up in the loop at index = [24].

Beginning test run...

Size of []:96
Value[0]=#0P1500#1P1500#2P1000#3P570#4P1500#5P2400#6P510#8P1500#9P1500#10P1500#1
1P1400T1000
Value[1]=#2P1100
Value[2]=#0P2000 #1P1100 T100
Value[3]=#2P750
Value[4]=#9P860S3000 #11P2500S1500
Value[5]=#9P900S2500 #11P1200S1500 #8P900S3000 #10P900S2500
Value[6]=#9P1500S2000 #11P1500S1000 T500
Value[7]=#9P2200S3000 #11P870S1500
Value[8]=#10P1100S1667 #8P2250S1667 T500
Value[9]=#10P1500S1667 #8P1500S1667 T500
Value[10]=#10P2200S1667 #8P750S1667 T500
Value[11]=#8P1500S1667 #9P1500S2000 #10P1500S1667 #11P1500S1000 T500
Value[12]=#8P1500S1667 #9P1500S2000 #10P1500S1667 #11P1500S1000 T1500
Value[13]=#5P2500 #6P650 T100
Value[14]=#4P2200
Value[15]=#4P1500
Value[16]=#4P750
Value[17]=#4P2200T1000
Value[18]=#9P900S2000 #11P1200S1000 #8P1000S1667 #10P900S1667 T300
Value[19]=#3P570
Value[20]=#3P600
Value[21]=#3P680
Value[22]=#3P790
Value[23]=#3P1005
Value[24]=
Press Enter to return to Quincy...

edited:

#include <stdio.h> 
#include <conio.h> 
#include <iostream>	// std::cout

using namespace std ;

// allocating WORST CASE length
const char* MoveCommand[]={
"#0P1500#1P1500#2P1000#3P570#4P1500#5P2400#6P510#8P1500#9P1500#10P1500#11P1400T1000",
"#2P1100",
"#0P2000 #1P1100 T100",
"#2P750",
"#9P860S3000 #11P2500S1500",
"#9P900S2500 #11P1200S1500 #8P900S3000 #10P900S2500",
"#9P1500S2000 #11P1500S1000 T500",
"#9P2200S3000 #11P870S1500",
"#10P1100S1667 #8P2250S1667 T500",
"#10P1500S1667 #8P1500S1667 T500",
"#10P2200S1667 #8P750S1667 T500",
"#8P1500S1667 #9P1500S2000 #10P1500S1667 #11P1500S1000 T500",
"#8P1500S1667 #9P1500S2000 #10P1500S1667 #11P1500S1000 T1500",
"#5P2500 #6P650 T100",
"#4P2200",
"#4P1500",
"#4P750",
"#4P2200T1000",
"#9P900S2000  #11P1200S1000 #8P1000S1667 #10P900S1667  T300",
"#3P570",
"#3P600",
"#3P680",
"#3P790",
"#3P1005"
};
 
 const char cr=13;

int main()
{
	cout << "Beginning test run... \n\n\n" ;
	int size = sizeof(MoveCommand) ;
	cout << "Size of []:" << size << "\r\n" ;

  	for (int i=0;i<63;++i) 
  	{ 
  		cout << "Value[" ;
  		cout << i ;
  		cout << "]=" ;
  		cout << MoveCommand[i] ;
  		cout << "\r\n" ;
  	}

   return 0;
}