Log´s
In C :
You can also redirect stderr, since some fucntions, like perror(), write there by default.
In C++
You can try and redirect cerr, but it's UGLY.
Edited by - Fruny on March 3, 2002 5:55:21 AM
|
You can also redirect stderr, since some fucntions, like perror(), write there by default.
|
In C++
|
You can try and redirect cerr, but it's UGLY.
Edited by - Fruny on March 3, 2002 5:55:21 AM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Just do :
#include <stdio.h>
FILE *File_Log;
main()
{
if (!fopen("File.txt","w"))
printf("Error\n");
else
printf("File created\n");
for (int i = 0; i < 5; i++)
fprintf(File_Log,"Number %i\n", i);
fclose(File_Log);
return 0;
}
========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
#include <stdio.h>
FILE *File_Log;
main()
{
if (!fopen("File.txt","w"))
printf("Error\n");
else
printf("File created\n");
for (int i = 0; i < 5; i++)
fprintf(File_Log,"Number %i\n", i);
fclose(File_Log);
return 0;
}
========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/

Edited by - Fruny on March 3, 2002 8:56:22 AM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement