Ok but now this errors came

I have in main include .h

#include <iostream>
#include <string>
#include "TwoDimArray.h"

using namespace std;
int main()

TwoDimArray Array1( 3,4);

print( Array1[0][0], 3, 4);
-------------------------------
the question is why do not recognize print function in main

: error: âprintâ was not declared in this scope


and I have in the .h and the .cpp file


void print(int** ,int , int);// .h file


void TwoDimArray::print(int** arr, int x , int y)// .cpp file

Ok ......Array1.print()
I did but I got those errors

.cpp: In function âint main()â:
.cpp:25: error: invalid conversion from âintâ to âint**â
.cpp:25: error: initializing argument 1 of âvoid TwoDimArray::print(int**, int, int)â



Last edited on
If it is a 'TwoDimArray' member, you should call it like this: Array1.print(/*arguments*/);
Why have you posted twice?
Topic archived. No new replies allowed.