ok, got it, now it's right and its works!
****************************************
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main () {
FILE *fp;
char str[80];
//Open file
fp = fopen("myfile.txt", "w");
//writing to file
fprintf(fp, "This is a system programming language.");
fp = freopen("myfile.txt", "r", fp);
fgets(str, 80, fp);
printf("%s\n", str);
fclose(fp);
return(0);
}
*************************************************