Home Discussion Discuss: C file read example

  • Example don't workVess Georg February 12, 2013 at 7:09 PM

    1. The output from source code and showed output are different: - in source code function printf("Open file: ..... is before filename reading with gets(file). - showed output hasn't a line with input a filename - gets() is a function with echo and character input is displaying on the screen. 2. In source code has an error with printf - this printf doesn't output filename: - no %s - need to be printf("Open file: %s", ...) - %s need a parameter of type *char but the current parameter is a **char (&file is a pointer to parameter 'file' and 'file' is a *char). As a result we will have output a sequence of symbols, started from address of 'file' variable in memory and nobody can know the length of sequence (somewhere program will find a zero-byte and will stop).

  • c progammingcharmin January 28, 2012 at 11:10 PM

    thank u for giving me the source code

  • FileRead.cPawan Kumar January 31, 2012 at 5:51 PM

    This above file read code doesn't work.Please help me to correct it.

  • your postAnubhab91 February 20, 2012 at 7:47 PM

    Thank you. Your post was useful.

  • c language programmingfalco September 1, 2012 at 1:23 PM

    how can I write a programme that will create a file that can store CV 's.

  • help meali December 30, 2012 at 2:52 PM

    if I want to make a map for a C program how I can make pages for my program map.please,help me how I can go to next page of map.very very thanks:D

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
Related Articles
Java Beginners

Read file in java
Read file in java  Hi, How to Read file in java? Thanks   Hi, Read complete tutorial with example at Read file in java. Thanks 

C Tutorials

C file read example
C file read example       This section demonstrates you to read a line from the file. You can see in the given example, we prompt the user to enter the name of the file to read 

PHP Questions

Read external file in PHP
Read external file in PHP  How to read external files in PHP in particular time duration and save that file with the latest date. How is it possible? Please explain with an example. Thanks 

Java Beginners

Java read binary file
Java read binary file  I want Java read binary file example code that is easy to read and learn. Thanks   Hi, Please see the code at Reading binary file into byte array in Java. Thanks   Hi, There is many 

PHP Tutorial

Read a zip file.
zip_entry_read() In this example the function zip_entry_read() will help in reading a zip file. First select a file to be opened. Name that file into zip file and direct the zipread command to read it through while loop. The zip_entry 

Mobile Applications Questions

J2ME Read Multiple File - MobileApplications
J2ME Read Multiple File  Hello I have read a topic "J2ME Read File", but that example is specify for a single file, but what if i want read more file one after the other just like Books. And an example will i appreciate thanks 


How to Read a File in Java
can be very inefficient. Example Here is the program to read a file in Java...How to Read a File in Java? In this section we are going to know, How to read a file in Java. We have to follow three step to read a File. First get 

Java Beginners

Read bufferedreader
Read bufferedreader  Tell me the example of Read file using bufferedreader. Thanks   Read the tutorial Reading file using BufferedReader class. Thanks 

Java Beginners

Java read lines from file
Java read lines from file  Any code example related to Java read lines from file? In my project there is requirement of reading the file line by line... to read the whole file in one go. So, in my case reading file line by line is only 

Java Code Examples

Java Read CSV file
Java Read CSV file In this tutorial, you will learn how to read csv file. CSV... and there is no need of using any API to read these files. In the given example, we have opened a file data.csv  and created a BufferedReader object to read 


Read the File
Read the File     ... see an example that reads the contains of the existed file. The given example... ReadFilter This is a text file C:\nisha> Download 

Java Technology Tutorials

Read file into String
Read file into String In this section, you will learn how to read a file.... In the given example we have used BufferedReader class along with FileReader class to read data from the file using it's read() method. This data is then stored 


J2ME Read File
J2ME Read File       In this J2ME application, we are going to read the specified file. This example shows you how to read the data of the specified file. To implement this type 

Java Beginners

read a file
read a file  read a file byte by byte   import java.io.File... static void main(String[] args) { File file = new File("D://Try.txt"); try { FileInputStream fin = new FileInputStream(file); byte 


Java read file
line. Example of Java Read File: package FileHandling; import...There are many ways to read a file in Java. DataInputStream class is used to read text File line by line. BufferedReader is also used to read a file in Java 

Java Beginners

Java read entire file into byte array
Java read entire file into byte array  Where is the example of Java read entire file into byte array on your website? Thanks   Hi, Its... complete example at Reading file into bytearrayoutputstream Thanks 

Java Beginners

Java read file contents into byte array
Java read file contents into byte array  Hello share the code of java read file contents into byte array with me. It's urgent. Thanks   Hi, This is simple process if you use the InputStream class. Read example 

Java Beginners

file read
file read  hi i am reaing from a file which has punjabi words. can some one help with me some code 


How To Read File In Java
. Example This example demonstrates that how to read a file in java. To read a file...How To Read File In Java In this section we will discuss about about how data of a file can be read in Java. A file can contain data as bytes, characters 


How To Read File In Java with BufferedReader
How To Read File In Java with BufferedReader class - example code This tutorial shows you how you can read file using BufferedReader class in your program... java.io.*; /** * How To Read File In Java with BufferedReader class 

Java Code Examples

Java read file line by line
Java read file line by line In this section, you will learn how to read a file... are going to read a file line by line. For reading text from a file it's better... { File f = new File("C:/Hello.txt"); if (!f.exists() && f.length() < 0 

Java Beginners

Read file into byte array java code eample
Read file into byte array java code eample  Hi, I have a project where I have to write for that reads file into byte array. I want a code java code...;Hi, Check the code example of the tutorial: Reading binary file into byte 

Java Beginners

How to Read a file line by line using BufferedReader?
at a time very efficiently. View the detailed example and code at Java Read File Line...How to Read a file line by line using BufferedReader?  Hello Java... problem is to find the best way to read the file in Java. I just searched the google 


How to read text file in Servlets
file in servlets. In this example we will use the input stream to read the text from the disk file. The InputStreamReader class is used to read the file... How to read text file in Servlets   

Core Java

How to read properties file in java
How to read properties file in java Description of Example:- In this example...= 8285279608 Example of Read properties file in java import java.io.... read properties file;- ResourceBundle. Properties Class.   

Programming Tutorials

How to make a file read-only
Description: This example demonstrate how to create a file and how to revoke... a file with specified name with read-only attribute. You can also check the the file properties, by default it is read-only 


Java read text file
;: Example of Read text File Line by Line: import java.io.*; class FileRead...In the section we are discussing about how to read file line by line. Here we... a text file one line at a time. It can also be used to read large text files 

Java Beginners

Program to read a dynamic file content - Java Beginners
Program to read a dynamic file content  Hi, In a single.... For example: Folder name "Sample". Inside that "010209.txt", "020209.txt", "030209.txt","040209.txt". In a single file I'll get the datas 


How to read properties file in Java?
Example program of reading a properties file and then printing the data... to value. The java.util.Properties class is used to read the properties file... extensions. Here is example of property file: name=Rose India address=Rohini, Delhi 


Java - Read file Applet
or applet viewer. Full running Read File Example code is given below: Here is the code... Java - Read file Applet     ... an applet can read the content from the given file. In this program we passes