@mir@ice.ch3.st
how does one love oneself? how does one love others? the way ive been doing it is apparently not correct
how does one love oneself? how does one love others? the way ive been doing it is apparently not correct
and it's done
...well, the outside
@green ope good catch
@green now, what's with these \377 and \375 (broken characters, they render even worse in a normal terminal)
hm my program executes fine but then segfaults
heres the program btw. test.txt and txt2.txt are files with keysmashes and copypasta in the working directory. im just running gcc mircat.c and it spits out a a.out that's executable
/*
my first C program ever! gonna make a copy of `cat` with maybe extra features
idk
/* */
#include
#include
char* greeting = "bonjour";
char *fnames[] = {"test.txt","tst2.txt"};
int catfile (char* file){
FILE *stream ;
int beg ;
int end ;
stream = fopen(file, "r") ; // type `FILE *`
fseek(stream, 0, SEEK_SET);
beg = ftell (stream); // should always be 0
fseek(stream, 0, SEEK_END);
end = ftell (stream); //end of file
char contents[end] ;
for (int i = beg; i <= end ; i++) {
fseek(stream, i, SEEK_SET); // go to next position
contents[i] = fgetc (stream); // get char at said pos and assign it thusly
};
printf ("file %s starts at %ld and ends at %ld\nits contents follow:\n%s\n\n",
file, beg, end,
contents
);
};
int main (){
printf ("%s\n\n",
greeting);
for (int i = 0; i <= 2; i++) {
catfile (fnames[i]);
} ;
return 0;
}
hm my program executes fine but then segfaults
what #backup solution do y'all use for #sharkey ? trying to get the best sense i can of what's required. preferably some kind of shell script