Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int m = 5,n = 5;
- int map[n+1][m+1];
- FILE *f;
- f = fopen("data1.txt", "r");
- if (f == NULL)
- {
- printf("ERROR\n");
- }
- else
- {
- for(int i = 1; i <= n ; i++){
- for(int j = 1; j <= m ; j++)
- {
- fscanf(f, "%d", &map[i][j]);
- printf("map[%d][%d] = %d\n", i,j, map[i][j] );
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement