Just checking, are we supposed to write each block we fread() from the input with each element in the same order as we read them from the input file, or are we supposed to write them with each element in reversed position? For example, if the input file contained, "Hello world", are we supposed to make the output file "world Hello", or are we supposed to make it "dlrow olleH"?

1 Answer 1


You need to reread the problem statement: https://cs50.harvard.edu/x/2023/psets/4/reverse/

that specifies which data you are supposed to reverse and which you are not. You haven't read it carefully enough.

Your example is poor because the input file CAN NOT simply be "Hello world" because the input file is a WAV file. It has a specific format which includes headers and structural data that you are not supposed to alter.

For the data you are reversing you 'would' want 'dlrow olleH' however.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .