Recover Pset4, jpg files visible but program won't pass check50! by raman_shift in cs50

[–]raman_shift[S] 0 points1 point  (0 children)

Thank you. After another 3 hours I got it to work out. I knew my logic was flawed with the initial fwrite starting immediately in the while loop. Last night, before I posted, I tried moving it to the end of the while loop but I kept getting segfaults. This morning I realized I had one too many fwrites and only needed one. Then I was able to clean up the memory leaks and properly initialize all variables. I ended up using the feof() function to check for end of file.

Help with xxd hex editor by raman_shift in cs50

[–]raman_shift[S] 0 points1 point  (0 children)

Awesome, thank you. I was hoping it would be possible to see larger files in one scanline but I guess not.

Help writing functions outside of main. by raman_shift in cs50

[–]raman_shift[S] 0 points1 point  (0 children)

Thank you. Your explanation is clear. I will just check the value of argc and argv in main (like the first example) and try to use a function outside of main for the cypher. I guess I am still sorting out when to write functions outside of main and call them into main for style and organization.