mirror of
https://github.com/kevinnlsamuel/stdouterr.git
synced 2025-12-06 09:55:58 +05:30
init coding and test thing
This commit is contained in:
24
src/main.c
Normal file
24
src/main.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
|
||||
char *output = "This is output", *error = "This is an error message";
|
||||
int printOut = 0, printErr = 0;
|
||||
|
||||
void write_stdout(){
|
||||
fprintf(stdout, "%s\n", output);
|
||||
}
|
||||
|
||||
void write_stderr(){
|
||||
fprintf(stderr, "%s\n", error);
|
||||
}
|
||||
|
||||
int main(int argc, char const *argv[]) {
|
||||
|
||||
if(argc > 1){
|
||||
//parse the arguments
|
||||
}
|
||||
|
||||
write_stdout();
|
||||
write_stderr();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user