Re: Hey, could someone critique a little app I did?

1998-05-31 Thread Henrik Nordstrom
R. Brock Lynn wrote: How do I effectively use getopt? BUGS This manpage is confusing. Do as in the example written in the manpage. It explains the usage much better than any words (if you ignore the _long parts). If you rather read words, read the info page (getopt is documented in

Re: Hey, could someone critique a little app I did?

1998-05-28 Thread Glynn Clements
holotko wrote: But for testing null pointers, I use `!'. In this context, it seems BAD. I worked in envinronments where NULL is ((void *)-1UL). If you use ! to check for a NULL pointer you make your code not portable. What is the best, all round "most portable" means of testing for

Re: Hey, could someone critique a little app I did?

1998-05-28 Thread Andrea Arcangeli
On Thu, 28 May 1998, Pete Ryland wrote: see http://www.eskimo.com/~scs/C-faq/s5.html for info on the NULL pointer. Thanks a lot for the pointer, I found it very interesting. An interesting page is also: http://www.eskimo.com/~scs/C-faq/q5.17.html where there are listed many machines

Re: Hey, could someone critique a little app I did?

1998-05-27 Thread holotko
Andrea Arcangeli wrote: On Mon, 25 May 1998, Glynn Clements wrote: But for testing null pointers, I use `!'. In this context, it seems BAD. I worked in envinronments where NULL is ((void *)-1UL). If you use ! to check for a NULL pointer you make your code not portable. What is the

Re: Hey, could someone critique a little app I did?

1998-05-27 Thread Andrea Arcangeli
On Thu, 28 May 1998, Pete Ryland wrote: ok - this is often confused. the c faq has a *big* section on this... NULL should be defined as 0. Ok. 0 cast to a pointer type is defined as an undefined pointer and can be implemented by the compiler as any number (including -1, or something This

Re: Hey, could someone critique a little app I did?

1998-05-27 Thread Pete Ryland
see http://www.eskimo.com/~scs/C-faq/s5.html for info on the NULL pointer. summary of this: 5.1 there is a special value--the ``null pointer''--which is distinguishable from all other pointer values and which is ``guaranteed to compare unequal to a pointer to any object or function.'' 5.2 ``0''

Re: Hey, could someone critique a little app I did?

1998-05-26 Thread Andrea Arcangeli
On Mon, 25 May 1998, Pete Ryland wrote: Don't be fooled! Just because it looks smaller in your c source, it doesn't mean it'll be faster. It *should* generate the same code, so the Heheheheh it' s faster to type ;-). This should be the only reason ! is been implemented in C and I take

Re: Hey, could someone critique a little app I did?

1998-05-26 Thread Andrea Arcangeli
On Mon, 25 May 1998, Glynn Clements wrote: But for testing null pointers, I use `!'. In this context, it seems BAD. I worked in envinronments where NULL is ((void *)-1UL). If you use ! to check for a NULL pointer you make your code not portable. Andrea[s] Arcangeli

Re: Hey, could someone critique a little app I did?

1998-05-26 Thread Glynn Clements
Andrea Arcangeli wrote: But for testing null pointers, I use `!'. In this context, it seems BAD. I worked in envinronments where NULL is ((void *)-1UL). That's _really bad_. ANSI C requires stdio.h to define NULL as being equivalent to zero. If you use ! to check for a NULL pointer you

Re: Hey, could someone critique a little app I did?

1998-05-25 Thread Glynn Clements
Pete Ryland wrote: On Sat, 23 May 1998, Glynn Clements wrote: Personally, I avoid using `!strcmp(...)'; I find `strcmp(...) == 0' to be more intuitive. __Personally__ I like the opposite ;-). I always use ! when I can. It' s faster and nicer. Don't be fooled! Just because

Re: Hey, could someone critique a little app I did?

1998-05-24 Thread Pete Ryland
On Sun, 24 May 1998, Andrea Arcangeli wrote: On Sat, 23 May 1998, Glynn Clements wrote: Personally, I avoid using `!strcmp(...)'; I find `strcmp(...) == 0' to be more intuitive. __Personally__ I like the opposite ;-). I always use ! when I can. It' s faster and nicer. Don't be

Re: Hey, could someone critique a little app I did?

1998-05-23 Thread Jakob Andreas Baerentzen
On Wed, 20 May 1998, R. Brock Lynn wrote: It is supposed to generate random integers in a certain range specified by two endpoints inclusive. i.e.: randomit 10 100 will send to stdout a random long int between 10 and 100. should work for negative numbers too. My code is included. Please