This code should do the job.
char** pointer = boardArr;for(int i = 0; i < rows; i++) {
getline(inFile, line);
for(int j = 0; j < cols; j++) {
*pointer = pos; pointer++; }
pointer++;
Please test that the ++ operator does the correct job.
Remark: when you work one column, the next offset starts
after the column. So
int offset = (i * row) + j;
PS: my experiences saying that careful bounds checking is the fundament of pointer arithmetics. It is a common source of problems :-O