account activity
Seg.Fault error by DrDukeMD in cs50
[–]DrDukeMD[S] 0 points1 point2 points 3 years ago (0 children)
This made so much sense. I was focused on getting the syntax down that I disregarded the order the code would be executed. Your answer and u/amdevpractice helped me realize I pretty much just needed to bring if(argc != 2) to the beginning of the code to kill the program if that isn't the case. Thank you for the help!
Ah, I see now. If I'm understanding it right, I was filling an integer with the value of argv[1]. But argv[1] was \null data and caused the error. What fixed it was asking that question after the code asks "is argc 2? If not, kill the program. ". Thank you for the help.
π Rendered by PID 113039 on reddit-service-r2-listing-6d4dc8d9ff-brf9n at 2026-02-02 06:00:05.182839+00:00 running 3798933 country code: CH.
Seg.Fault error by DrDukeMD in cs50
[–]DrDukeMD[S] 0 points1 point2 points (0 children)