CS50 recover segmentation fault Oct 2020
问题 I'm new to coding and started with Harvard's CS50 course. I've written some code for recover for cs50, and tried to run it, but segmentation fault occurs. In need of some help in identifying what's wrong. #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: ./recover image\n"); return 1; } FILE *file = fopen(argv[1], "r"); if (file == NULL) { printf("Usage: ./recover image\n"); } char filename[8];