fopen does not return

后端 未结 4 891
感情败类
感情败类 2021-02-15 02:49

I used \'fopen\' in a C program to open a file in readonly mode (r). But in my case I observed that fopen call does not return. It does not return NULL or valid pointer - execut

4条回答
  •  广开言路
    2021-02-15 02:59

    Is it possible that you've redefined a symbol in the reserved namespace: either something beginning with two underscores, an underscore and a capital letter, or any of the standard C library functions? If so, that results in undefined behavior, and it's possible that fopen somehow ends up calling part of your code instead of the correct code in the standard library.

    This question has a major "missing information" smell to it. I seriously doubt the code snippet in the question has the behavior OP has described when it appears by itself in main, and I wonder if OP hasn't done some bogus stuff he's not telling us about...

提交回复
热议问题