The fscanf function is weird

Asked 2 years ago, Updated 2 years ago, 28 views

int* Load_File(void) {

    FILE * fp;

    fp = fopen("Birthday.txt", "r");
    int idx;
    int arr[100];

    for (idx = 0; idx < 58; idx++) {

        fscanf(fp, "%d\n", &arr[idx]);

        cout << arr[idx] << endl;
    }

    return arr;
}

0x0FC3ED76 (ucrtbased.dll) has an unhandled exception. An invalid parameter was passed to a function that considers the invalid parameter to be a serious error. fscanf displays this error ㅠ

c++

2022-09-22 16:52

1 Answers

fclose(); You ate the function. fclose(fp); is also included in the source code.


2022-09-22 16:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.