answersLogoWhite

0

file = fopen("numbers.txt", "r");

this way you can open a file in your working directory.

file = fopen("/home/student/numbers.txt", "r");

this way, you can give the path and open a file.but i don't know how search for a file and open it.if someone can help me...

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you upload file in console application?

In a console application, you typically upload a file by prompting the user to provide the file path and then using file handling functions to read the file. For example, in C#, you can use File.ReadAllText() or File.ReadAllLines() to read the contents of the file after validating the path. In Python, you can use the built-in open() function to access the file. Ensure proper error handling to manage cases where the file may not exist or the path is invalid.


You want a file handling c program?

yes


Is this a file path c documentsspring 2012cis 101term papercomputer technology is an example of a?

of a file name with path.


What is a part of a file path?

A part of a file path refers to an individual component that makes up the complete address of a file or directory within a file system. This includes the drive letter (in Windows), folder names, subfolders, and the file name itself, often accompanied by its extension (e.g., .txt, .jpg). For example, in the path C:\Documents\file.txt, "C:", "Documents", and "file.txt" are all parts of the file path. Each part helps locate the file within the hierarchy of the file system.


What is the default path for the folder where the active directory log file will be stored?

program file in c:\ drive


What is basic structure of file handling in c language?

open, read/write, close


What is the difference between path name and file name?

A file name refers to the name of a specific file, while a path name represents the location of a file within a file system. The path name includes the file's directory structure, providing the file's exact location on a computer.


What is file handling in c and c plus plus or objective c?

File handling is simply the process of opening, reading, writing and closing files. Files are simply streams for input and output, or the "serialisation" of objects. In other words, reading and writing data to and from disk storage.


You know that windows will be installed in the c drive windows folder what is the path to the answer file?

C:\windows\winn.sif


What is definition of file handling in c plus plus?

File is a place where information or data is stored. we make use of some of the file-handling functions in c like: fopen()-for opening a file. fclose()-to close a file. Every file being opened for any operations like: "r"- Read-Only mode. "w"-Write-only mode. "a"-append mode. "r+"-read+write mode. "w+"-write+read mode. "a+"-read+append mode. We should make use of FILE pointer ,in order to perform any such operations on the files. There are many input and output functions used along with files. fgetc() fgets() fscanf() fputc() fprintf() fputs() fseek() rewind() File handling is used to read or write a file without directly opening it.its contents are opened in another files by using above specified commands in c++ programming for file handling we have to use a header file but in c noheader file regarding to file handling is required


You want C program on students information record using file handling?

yes sir


How do you set path in command prompt?

To set a path in the Command Prompt, you can use the set command. For example, to temporarily add a directory to your PATH variable, you can type set PATH=%PATH%;C:\Your\Directory. This change will only last for the duration of the Command Prompt session. To make a permanent change, you can modify the PATH variable through the System Properties in the Control Panel or by using the setx command, like setx PATH "%PATH%;C:\Your\Directory".