Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 01 Sep 2011 18:39:12 -0500 Message-ID: <4E6017A1.4170@mindspring.com> Date: Thu, 01 Sep 2011 19:39:13 -0400 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: I think this is an impossible assignment...could you help? References: <1br540b0oo.fsf@snowball.wb.pfeifferfamily.net> <4E5FD915.30806@verizon.net> <1bmxeoass1.fsf@snowball.wb.pfeifferfamily.net> <1bty8vrgpn.fsf@snowball.wb.pfeifferfamily.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 48 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.223.242 X-Trace: sv3-fbKT/UEC8xM2xVF1QmFZaDHwsttvYfFrEy/ksv/5UunIt9Zk/uFGQI8JaH3FTuFgb3SbEun7OkA05pB!hDZBqkKSFqnovYBhFS8TbvjpnHmfTQqxiqc25pnlD5RRKvINiEztkiBXW5ZPivxB9PUPl3wfdmm1!FRhyVX7PVHQ= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2490 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:9853 Joe Pfeiffer wrote: > > Keith Thompson writes: > > > Joe Pfeiffer writes: > >> James Kuyper writes: > > [...] > >>> scanf() doesn't happen to be one of those functions; the required > >>> behavior for scanf() can be implemented entirely in C code that calls > >>> other C standard library functions, without using any of the other > >>> members of the scanf() family. But if your argument were valid, it would > >>> also apply to fgetc(). > >> > >> Actually, I was unaware that fgetc() had any non-C code in it -- what > >> does it do that requires assembler? > > > > fgetc() cannot be written in *portable* C. > > What in it requires non-portable C? This doesn't exactly answer your question, but getc and fgetc are very close in what they do. There is some chance that if getc is implemented on you machine as a macro, that you can use the following program to see how the implementation that you are using, implements getc. /* BEGIN new.c */ #include #define str(x) # x #define xstr(x) str(x) int main(void) { puts(xstr(getc(stdin))); return 0; } /* END new.c */ -- pete