Answer the question
In order to leave comments, you need to log in
How to display variables in a text document?
In general, according to the assignment, the values of the matrix after summation should be output to a txt file in a certain order.
As I understand it, this is done through FILE and fopen, but can someone specifically parse everything in detail? Thanks in advance for your replies.
PS on the example of just some two variables
Answer the question
In order to leave comments, you need to log in
int a = 0; //переменная
int b = 0; //переменная
FILE* file = fopen("file.txt", "w"); //открытие файла с разрешением на запись
fprintf(file, "%d %d ", a, b);//запись в файл формат-строкой с пробелами
fclose(file); // закрытие файла
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question