S
sofin
I have a 2-dimension array whose format can be either float or
integer.
I would like to write a function to print out this array no matter its
format is float or integer.
I don't know how to pass the argument because the format of the array
could be float or int?
void function(float array, row, col){
^^^^^^
Could be also int
int i=0;
int j=0;
for(j=0;j<col;j++){
for(i=0;i<row;i++){
cout << array[j] << endl;
}
}
}
integer.
I would like to write a function to print out this array no matter its
format is float or integer.
I don't know how to pass the argument because the format of the array
could be float or int?
void function(float array, row, col){
^^^^^^
Could be also int
int i=0;
int j=0;
for(j=0;j<col;j++){
for(i=0;i<row;i++){
cout << array[j] << endl;
}
}
}