Howdy, Stranger!

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

Categories

fopen() probs...

mwronskimwronski Member Posts: 62
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

  • SteveCSteveC Member Posts: 63
    : 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?


  • Shawn CarterShawn Carter Member Posts: 0

    ________ / http://forcoder.org / free ebooks and video tutorials about ( C++, Java, Go, C, Delphi, Visual Basic, Assembly, C#, Visual Basic .NET, PL/SQL, Ruby, Swift, R, MATLAB, Scratch, Python, JavaScript, Perl, PHP, Objective-C Transact-SQL, Lisp, Crystal, Kotlin, ML, Alice, F#, VBScript, Clojure, Logo, ABAP, Ada, FoxPro, Scala, COBOL, Hack, Fortran, Lua, Awk, Scheme, LabVIEW, Rust, SAS, Julia, D, Erlang, Dart, Bash, Apex, Prolog ) ______________

Sign In or Register to comment.