Re: function
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Sat, 31 May 2008 12:34:26 -0400
Bill Cunningham wrote:
.... snip ...
comparing argument with a without a cast or something like that
the compiler said. Without cast and comparing was mentioned by
the compiler but it compiled and didn't work. So I tried this.
if((fputc(a,fp))==NULL)
puts("fputc error");
When I ran the binary fputc error was mentioned 10 times. My
2nd arg was 10.
Look up what a function does and returns before you use it. In
this case:
7.19.7.3 The fputc function
Synopsis
[#1]
#include <stdio.h>
int fputc(int c, FILE *stream);
Description
[#2] The fputc function writes the character specified by c
(converted to an unsigned char) to the output stream pointed
to by stream, at the position indicated by the associated
file position indicator for the stream (if defined), and
advances the indicator appropriately. If the file cannot
support positioning requests, or if the stream was opened
with append mode, the character is appended to the output
stream.
Returns
[#3] The fputc function returns the character written. If a
write error occurs, the error indicator for the stream is
set and fputc returns EOF.
Note the returned value.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
.
- References:
- function
- From: Bill Cunningham
- Re: function
- From: Joachim Schmitz
- Re: function
- From: Bill Cunningham
- Re: function
- From: Joachim Schmitz
- Re: function
- From: Bill Cunningham
- function
- Prev by Date: Re: function
- Next by Date: Re: How to trace function calls?
- Previous by thread: Re: function
- Next by thread: Re: function
- Index(es):
Relevant Pages
|