Código
#include<iostream> #include<fstream> using namespace std; void crear_mundo (char**M, int f, int c, istream& a, int i, int j) { for (i = 0; i < f; i++) { for (j = 0; j < c; j++) { a>>M[i][j]; } } for (i = 0; i < f; i++) { for (j = 0; j < c; j++) { cout << M[i][j] << " "; } cout << endl; } delete [] M; } int main() { ifstream a("mundo.txt"); int i,j,f,c; a>>f; a>>c; char **M = new char* [f]; for (i = 0; i < f; i++) { M[i] = new char[c]; } crear_mundo (M, f, c, a, i, j); return 0; }
¿De que manera podria hacerlo?
Agradezco su ayuda!!!!!