× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Sat, 18 Jan 2014, frank kolmann wrote:

Presumable it has compiled elsewhere.
http://www.c-program-example.com/2012/02/k-r-c-programs-exercise-5-20.html

As already mentioned, this appears to be bad code. Right away, the double slashes aren't valid for start of comment in plain C (but are valid in C++ nad other languages). Other bad code jumps out in the dcl(void) function with these two statements:

for(ns = 0; gettoken() == '*';)
ns++;

This appears to simply increment ns as long as the gettoken() function returns character '*'. If that is really the intent they should have written:

for(ns = 0; gettoken() == '*'; ns++);

Nit picking, but indicative of other bad code to follow:

while(ns --> 0)

This code will never compile because there is no such thing as a --> operator in plain C. Maybe they meant => but you would just be guessing.

Start with an example that actually works instead of this useless stuff. Don't blame yourself, blame the terrible example.

James Rich

if you want to understand why that is, there are many good books on
the design of operating systems. please pass them along to redmond
when you're done reading them :)
- Paul Davis on ardour-dev

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.