#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int truyen(int *mang1chieu,int x,int y)
{
for (int xx=0;xx<x;xx++)
{
for (int yy=0;yy<y;yy++)
{
cout<<mang1chieu[xx][yy]<<" ";
}
cout<<endl;
}
}
int main()
{
int mang1chieu[2][2]={{6,7,8},{1,2,3}};
truyen(mang1chieu,1,1);
}
nó bị cái lỗi
||=== Build: Debug in a (compiler: GNU GCC Compiler) ===|
C:\Users\lioncyber97\Desktop\a\main.cpp||In function ‘int truyen(int*, int, int)’
C:\Users\lioncyber97\Desktop\a\main.cpp|11|error: invalid types ‘int[int]’ for array subscript|
C:\Users\lioncyber97\Desktop\a\main.cpp|15|warning: no return statement in function returning non-void [-Wreturn-type]|
C:\Users\lioncyber97\Desktop\a\main.cpp||In function ‘int main()’
C:\Users\lioncyber97\Desktop\a\main.cpp|19|error: too many initializers for ‘int [2]’|
C:\Users\lioncyber97\Desktop\a\main.cpp|19|error: too many initializers for ‘int [2]’|
C:\Users\lioncyber97\Desktop\a\main.cpp|20|error: cannot convert ‘int ()[2]’ to 'int’ for argument ‘1’ to ‘int truyen(int*, int, int)’|
||=== Build failed: 4 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|