Hello, have tried searching for a answer, but am most likely too dense to understand answers so far ;)
I am trying to create a bidimensional array of strings
code for this so far is
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string>
//#include "playgame.h"
using namespace std;
int iLives=0;
string CityList [10][3] =
{
string City0Str [3] = {"1","city0","state0"}; //error occurs here
string City1Str [3] = {0,"city1","state1"};
string City2Str [3] = {0,"city2","state2"};
string City3Str [3] = {0,"city3","state3"};
string City4Str [3] = {0,"city4","state4"};
string City5Str [3] = {0,"city5","state5"};
string City6Str [3] = {0,"city6","state6"};
string City7Str [3] = {0,"city7","state7"};
string City8Str [3] = {0,"city8","state8"};
string City9Str [3] = {0,"city9","state9"};
the error message i get is
|15|error: expected primary-expression before ‘City0Str’|
anyone able to shed some light here for me?
doh!
thank, feel a bit slly now.
this would also hold true for any other array of ny data type, correct?
eg
datatype name [x][x][x][repeat for each dimension] =
{add all values here,..,..,..,..};
repeat above
yes?