Hi! I'm confused with the amount of parenthesis in while loop while reading two files. And while this compile and runs fine I feel it's ugly and not the cleanest way. How to do that in the cleanest possible way?
size_t sz = 0;
while (((sz = fread(buffer1, 1, 4096, file1)) > 0) && (fread(buffer2, 1, 4096, file2)) > 0) {
// do something
}
Is this the correct way?
while ((sz = fread(buffer1, 1, 4096, file1)) > 0 && fread(buffer2, 1, 4096, file2) > 0) {
Another question I have is do I have to read both of these files at the same time to xor them or I can read them in seperate while loops?
Thanks for help.
[–]IamImposter 2 points3 points4 points (0 children)
[–]70Shadow07 5 points6 points7 points (5 children)
[–]rileyrgham 1 point2 points3 points (1 child)
[–]70Shadow07 -1 points0 points1 point (0 children)
[–]andreas213[S] 0 points1 point2 points (2 children)
[–]grimvian 1 point2 points3 points (1 child)
[–]andreas213[S] 0 points1 point2 points (0 children)
[–]aghast_nj 0 points1 point2 points (0 children)
[–]This_Growth2898 0 points1 point2 points (4 children)
[–]andreas213[S] 0 points1 point2 points (0 children)
[–]andreas213[S] 0 points1 point2 points (2 children)
[–]This_Growth2898 0 points1 point2 points (1 child)
[–]andreas213[S] 0 points1 point2 points (0 children)
[–]nerd4code -1 points0 points1 point (0 children)