Thank you very much, Salem.
Worked like a charm.
And about the macros, hah.. I was actually suggested to do that from this one website I was trying to figure out this on. Thanks for that link.
Yeah, I tried that as well.
Worked fine for printf.
I commented it out.
It did not work for write when I wrote it out to the file. It would write the entire buffer to the file.
I tried doing + 1 after I realized that, but it didn't work either.
It was as if too much space was being allocated if the byte size was odd.
I ended up multiplying the total byte size by two and allocating that space and it worked out just fine. I'm sure that's not the appropriate way to...
Checking each character on the first one.
char:h
char:e
char:l
char:l
char:o
char:
char:w
char:o
char:r
char:l
char:d
char:
char:Ù
char:
char:
Checking each character on the second one:
buff1 len: 4
tot_bytes: 15
buff1 len: 15
bytes_read: 15
hello worldsss
char:h
char:e
char:l
char:l
char:o...
I have to create a program with a system call and something is driving me nuts.
For some reason I get really odd results from a file with an odd number of characters:
48 struct stat buffer1;
49 fstat(d1, &buffer1);
50 size_t tot_bytes1 = buffer1.st_size;
51 char *buff1 =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.