im trying to create a simple program that creates an array; tells every element of the array to become the letter 'a'. and then print the full array. As you will soon find out im a newbie, and the line of code i typed makes somewhat of sense to me. I did some research and tried describing the pointers in different ways but none have worked. if someone could shed dome light id be delighted.
Code:#include <iostream> using namespace std; void resetTable(char *pTable[3][3]); void printTable(char *pTable[3][3]); int main(){ char tTable[3][3]; resetTable(&tTable[3][3]); printTable(&tTable[][]); system("PAUSE"); return 0; } void resetTable(char *pTable[3][3]){ for (int i=0;i<3;i++){ for (int j=0;j<3;j++){ *pTable[i][j] = {'a'}; } } } void printTable(char *pTable[3][3]){ for (int i=0;i<3;i++){ for (int j=0;j<3;j++){ cout<< *pTable[i][j]; } } }



LinkBack URL
About LinkBacks


