Re: HELP!! Two questions from <<the c programming language>>



Tak wrote:

No, that's not how it works here. You post your attempt, we help you
with problems. We don't do homework.

(fx:hint (fx:snipped-signature))

No, I think you are misunderstanding.
It's not homework;

I can't work out Exercise 1-9.
My code of Exercise 1-10 is like this:

#include <stdio.h>

main()
{
char c;

/int/ c.

while ((c = getchar()) != EOF)

`getchar` returns an `int`, because it must be able to return
every character value /and one more/, viz EOF. (Yes, this
presents problems on systems where `sizeof(int) == sizeof(char)`.)

I don't know whether it's right or not?

Does it pass your test cases?

--
"You've spotted a flaw in my thinking, Trev" Big Al,/The Beiderbeck Connection/

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN

.



Relevant Pages

  • Re: Education law....school detention
    ... My problem is sometimes the homework is set *purely* so one ... can say "we set homework". ... The dictionary exercise quoted by other posters shows that the value ... Having been a teacher, I could ...
    (uk.legal)
  • Re: Education law....school detention
    ... My problem is sometimes the homework is set *purely* so one ... can say "we set homework". ... The dictionary exercise quoted by other posters shows that the value ... does not mean that it lacks benefit. ...
    (uk.legal)
  • Re: Writing a specific program
    ... >> Have you ever bothered reading The C Programming Language by K&R ... There's an exercise on this and I simply don't know how to do ... > Your question looks very much like a homework assignment. ...
    (comp.lang.c)
  • Re: Best Practices for Security definitions
    ... I've always tried to avoid doing other people's homework for them. ... Seems the point of the exercise is to get to find this information on ... actually the problem is that you can find too many opinions. ...
    (comp.security.misc)
  • COME ON KEV! COME ON KEV!
    ... MW has the heavy hitters out of Great Britain [bloody little Belgium] ... As an exercise, homework, if you will, send a message saying "Hi, etc.," and ask to join. ...
    (misc.writing)