Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Does anyone know how to check if a file already exists in a C++ script? I know it will be really simple, but I cannot figure it out! Thanks for your help.
Name: berdon Date: May 21, 2002 at 15:17:50 Pacific
Reply:
Acutally it is pretty easy, though the function is not made specifically to do it. Here is an example.
#include
{ FILE * pFile; pFile = fopen ("myfile.txt","r"); if (pFile==NULL) { printf("File does not exist\n"); } return 0; }
0
Response Number 2
Name: Don Arnett Date: May 21, 2002 at 15:22:27 Pacific
Reply:
Please excuse me while I mention that C++ does not have scripts, it has programs, files, modules, and/or functions. C++ files have to be compiled and linked to create an executable file that can be executed.
A script is an ascii text file of commands that you execute by executing the text file.
If we all started to call dogs cats and cats dogs while pointing at them, everyone would know what we're talking about....but it just ain't right. The difference is HUGE.
Summary: I am just begining to learn about batch files and am starting out very easy. Is there any way to run a check on a batch file to show where you went wrong in the programing. I am working on a batch fil...
Summary: lol, (i'm null) that's funny. If you want to learn C++ I suggest you get the best damn c++ book available: C++ How To Program - Deitel AMAZON BARNES AND NOBLE BOOKSAMILLION it is a bit pricey...but w...
Summary: I have written a program which calculates matrices. Now I want to use those calculated matrices. So I want my C++ programm to generate a file on my computer and to copy the calculated matrix to this n...