Exforsys

Online Training

C file handling

This is a discussion on C file handling within the C and C++ forums, part of the Programming Talk category; hey folks..... m still an amateur in this part of d world n m dying get this code cracked. Hv ...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-01-2006, 08:59 AM
Junior Member
 
Join Date: Aug 2006
Posts: 1
pradyu is on a distinguished road
Unhappy C file handling

hey folks..... m still an amateur in this part of d world n m dying get this code cracked.

Hv got this program which asks me to print certain data on the screen , for a specified no. of times , by taking the input from a file named input.txt. Can nebody pls explain it to me how I can read the input from d text file n dependin on d i/p , print out d msg on d monitor.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-29-2006, 09:34 AM
Junior Member
 
Join Date: Jun 2006
Posts: 7
hat123 is on a distinguished road
So are you writing a program or do you have an existing program? If you are writing the program, look at the fread, fscanf, and fprint functions. If you have an existing program, then make sure you have the input.txt file with the appropriate data.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-02-2006, 06:06 PM
Junior Member
 
Join Date: Sep 2006
Posts: 1
bdsarwar is on a distinguished road
At first u should open the input.txt file in ur program.
FILE *file;
file = open("input.txt","r");
then u can use fscanf() function in several times and print the data into the console.
and also close the file by this command
fclose(file);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-05-2006, 06:47 AM
Senior Member
 
Join Date: Apr 2006
Posts: 125
ashlee is on a distinguished road
If you could place the code you have written or on which you have query I can help you out by seeing the code and correct the code and give you for you to use.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
how to open image file in c vijaykumarreddy C and C++ 4 07-30-2008 06:35 AM
strange result when read from different file hat123 C and C++ 3 07-06-2006 06:06 PM
C Programming - File management in C lokeshm C and C++ 1 06-17-2006 08:21 PM
how to write into notepad file through winrunner? mangalsachin2002 Testing Tutorials 2 04-03-2005 02:39 PM
ClassNotFoundExceptions after Installing EAR file akpraveen Java Tutorials 3 07-20-2004 08:51 PM


All times are GMT -4. The time now is 04:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.