fopen() probs...

How do I check if fopen() returned an error without the whole program crashing? If I just use if((fptr=fopen('asd','w'))==NULL) it still makes a runtime error. Is there a func() that checks if a file exists?

Comments

  • : How do I check if fopen() returned an error without the whole program crashing? If I just use if((fptr=fopen('asd','w'))==NULL) it still makes a runtime error. Is there a func() that checks if a file exists?
    :
    Probably because those strings should be in double quotes
    if((fptr=fopen("asd","w"))==NULL)

    Which brings me to my next point
    How many warnings do you still have in your code which you're either ignoring, or you've cast away just to get the compiler to shut up?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion