Re: problems using fgets() and sscanf() while modifying file contents
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Mon, 16 Jul 2007 00:47:56 -0700
allpervasive@xxxxxxxxx writes:
[...]
sorry for confusing you, i did a small mistake. now, here i attach the
exact code which i used.
hope now you can follow the code. input data and the desired output is
also shown below.
thanks
code:
void main()
main returns int, not void. The correct declaration is
int main(void)
See questions 11.12a, 11.12b, 11.14a, 11.14b, and 11.15 in the
comp.lang.c FAQ, <http://www.c-faq.com/>.
{
FILE *in1,*file2;
You haven't shown us your actual code. Without a '#include <stdio.h>',
the compiler doesn't know what a 'FILE' is; it would have rejected
your program with an error message, something like "Undeclared identifier".
You need to post your *exact* code, just as you fed it to the
compiler.
char file1[1000], file3[1000];
int num;
float value;
char in_region;
printf("\n\n Input File 1: "); /* Ask for File names */
gets(file1);
Never use gets(). See question 12.23 in the FAQ.
[snip]
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- References:
- problems using fgets() and sscanf() while modifying file contents
- From: allpervasive
- Re: problems using fgets() and sscanf() while modifying file contents
- From: Ben Bacarisse
- Re: problems using fgets() and sscanf() while modifying file contents
- From: allpervasive
- Re: problems using fgets() and sscanf() while modifying file contents
- From: Ben Bacarisse
- Re: problems using fgets() and sscanf() while modifying file contents
- From: allpervasive
- Re: problems using fgets() and sscanf() while modifying file contents
- From: Barry Schwarz
- Re: problems using fgets() and sscanf() while modifying file contents
- From: allpervasive
- problems using fgets() and sscanf() while modifying file contents
- Prev by Date: Re: problems using fgets() and sscanf() while modifying file contents
- Next by Date: Re: Basic question about pointers
- Previous by thread: Re: problems using fgets() and sscanf() while modifying file contents
- Next by thread: Re: problems using fgets() and sscanf() while modifying file contents
- Index(es):
Relevant Pages
|
Loading