need help to save a matrix and be able to reopen it

Hello :)

I have this simple code:

#include<stdio.h>
int main(void)
{
int mat[10][10],i,j;

printf("Enter your matrix\n");
for(i=0;i<4;i++)
for(j=0;j<4;j++)
{
scanf("%d",&mat[i][j]);
}
printf("\nHere is your matrix:\n");
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
printf("%d ",mat[i][j]);
}
printf("\n");
}

}

This program ends up having a matrix made by the user ( in this case a 4x4). So my question is:

How do I save the user-made matrix in a text file? And how will i be able to reopen it? =) Hope i can get some help
well yes Chris, I'v tried, but I just don't know how to save the actual matrix made by the user .. I just don't know how to implement it in my code :(
Topic archived. No new replies allowed.