comparison dis.c @ 1:b82f21466dfd

You can just printf the file what are you doing!
author VilyaemKenyaz
date Fri, 25 Aug 2023 22:59:12 -0400
parents e92d7e15bc33
children 2b6ce8d53356
comparison
equal deleted inserted replaced
0:e92d7e15bc33 1:b82f21466dfd
1 //Displays a program, alternative to "cat", uses my based file library 1 //Displays a program, alternative to "cat", uses my based file library
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 #include "basedfilelib.h"
2 6
7 void main(int argc, char* argv[]){
8 if (argc == 1 ) { puts("Dis by William King at Peep Soft\nDisplays a file to stdout, better than cat at this purpose\nUsage: dis (file)");exit(0);}
9 puts("Displaying:");
10 char * filetoread = argv[0];
11 char * file = ReadFile(filetoread);
12 printf("%s\n",filetoread);
13 printf("%s\n",file);
14 while(strlen(file) != 0){
15 char * print = ReadLine(file,1);
16 DeleteLine(file,1);
17 }
18 exit(0);
19 }
20