📄 cnews018.doc
字号:
Issue C News 2
=================================================================
THE HEAP by Barry Lynch
=================================================================
The postcards keep coming and we truly appreciate the
support that has been shown over the last two years. This issue
of C News marks the end of Volume 1 of C News. And beginning
with Issue 19, we will start Volume 2 with a few new twists.
(Can't say what they are yet, still working out the details...)
This issue contains another installment of Wayne
Dernoncourt's Beginner's Column. This month Wayne starts
exploring the wondrous world(???) of sort algorithms. Wayne's
article started as a result of a C News staff meeting we had at
a local pizzeria a few months ago. Matter of fact, quite a few
things had their start that night at the pizzeria.
Roy Browning took the time to sit down and write a few
words on his explorations into C++. While I can't claim Roy as
the official C News "C++" guru, we can look forward to his
thoughts as he discovers more about C++. Welcome aboard Roy!
Paul Castle sent us an article on command line parsing
which does a nice job of explaining the concepts of command line
parsing to beginner C programmers.
Jim Singleton - who is beginning to take over C News (grin)
- starts a series on software development in this issue. If you
recall, from a previous issue of C News, Jim and I started
developing an Opus utility to measure my BBS system usage.
Alas, Dan Kozak decided to show off and wrote an AWK script to
accomplish the same thing. Before Jim and I could get started,
Dan was already over the finish line. Well after that
embarrassing episode, Jim threatened Dan with bodily harm if he
showed off again. So I think we can safely assume that Jim's
article will continue in the next issue.
Announcing the Official C News t-shirt and coffee mug. All
contributors to C News get an official C News "Author" t-shirt,
and a coffee mug. Anyone else that wants one will have to
purchase them at cost. Remember that night at the pizzeria?
Well this is one of the ideas that came out of the discussion.
It seems that while Jim Singleton was riding on the steam train
ride at SOGEAST 89, he started talking to Dave Thompson
(Micro-Cornucopia Editor) about C News. It turns out that in
the early days of MicroC, they used to give T-shirts to
contributors instead of money. So after Jim came back from the
SOG, he dropped the idea of a C News T-shirt. Well, I thought
it wasn't a bad idea and now they are available in blue only.
Next year we will pick another colour.
Issue C News 3
Remember the old saying "if you need something done give it
to the busiest person?" Well if you don't, I do and that is the
story of my life these days. Some of you may have noticed that
I do not have as big a part in C News as I used to. It isn't
that I do not want to, but simply that work commitments are
taking all of my free time. However, Jim, Dan and Wayne have
done a great job of getting this issue of C News together. With
their continued support I have no doubt that 1990 will be a
bigger and better year for C News.
Barry
Issue C News 4
=================================================================
MAGAZINE REVIEW - INSIDE TURBO C by Jim Singleton
=================================================================
(NOTE: I initially reviewed "Inside Turbo C" after the first
issue, prior to publishing the review, I received issue number
two. Therefore, reviews of both issues appear here.)
Issue: Volume 1, Number 1 September 1989
Publisher: The Cobb group
P.O. Box 24412
Louisville, KY 40224-9960
"Inside Turbo C" is a new newsletter/magazine, published by
The Cobb Group, Inc. As the title suggests, the subject matter
is Turbo C. At sixteen pages in length, "Inside Turbo C" does
not take too long to read, especially since approximately half
of each issue is source code (seven pages in this issue). While
the articles are clear and concise, they do not attempt to go
into any topic in depth. It will be interesting to see if in
future issues there are articles which span several issues. The
first issue contains articles on interrupts, binary trees, and
fast screen input/output.
As mentioned, each issue contains source code. My biggest
complaint, as far as the appearance of the source code, is that
it is printed with line numbers, which actually makes it look
somewhat confusing. In addition, because of the length of each
issue, none of the articles really explore any topic in any
great depth. The biggest problem is that there are errors in
the source code. I know this often happens in books and
magazines, but here we are talking about a newsletter and I
don't think it should be too hard to check the source code prior
to publication. In fact, one listing is incomplete, it's
missing a number of lines of code.
In addition to the newsletter, subscribers also have access
to Cobb Group Information Services (CGIS) an on-line information
exchange from The Cobb Group. The Basic Service, which is free
to all subscribers, allows the user 15 minutes per day, a back
issues directory, product news, and an information center. A
Premium Service is also available, which allows users to
download source code, no time limit, on-line conferencing, and
the features included with the Basic Service. The Premium
Service is currently available at an "introductory rate" of $30
a year.
Speaking of costs, how much is "Inside Turbo C"? A year's
subscription costs $59. Actually, considering that the cover
price is $7, this represents a savings of $25. The price is the
biggest strike against "Inside Turbo C". It's too expensive for
Issue C News 5
its size, especially since there are a number of other
newsletters and magazines devoted to C. (As a matter of fact,
you're reading one now.)
------------------------------------------------------------
Issue: Volume 1, Number 2 October 1989
I wasn't too impressed with the first issue, of "Inside
Turbo C", so how was issue 2? Don't ask. Once again, the
articles are clearly written. So much for the good news.
Actually, the article on spawning a child process isn't too
bad, nor is the article on conditional compiling. The article
on choosing memory models seems out of place. If the audience
for "Inside Turbo C" is beginners, which is how the article on
spawning a child process is written (along with the introduction
to pointers article and the article on sound generation), this
article is almost useless. All this article really is, is a
definition of each memory model and it takes less than a page to
explain all of them. (A much better article on memory models
appears in issue 11 of the "C News".) If the information in the
Turbo C manuals isn't clear, this isn't going to help much
more.
Well, is the source code any better? The source code for
the article on pointers is long and hard to follow. An article
which is intended as an introduction to pointers should have
clear and concise examples as source code. Also, the one
include file, mcalc.h, makes me think the code is from the
examples provided by Borland when you purchase Turbo C. On the
bright side, it appears that each listing is complete, although
I didn't try all of the listings.
------------------------------------------------------------
NOTE: Since writing the above, I have received a letter from Tim
Landgrave, the Product Manager for Technical Journals for the
Cobb Group, which was sent to all subscribers to "Inside Turbo
C". Although it is a bit of an understatement, he admits that
there are problems with the first two issues of "Inside Turbo
C". Although I didn't catch it (probably because I don't have
the book), one of the examples in the first issue is straight
out of the book "Turbo Algorithms". Also, surprise, surprise,
the program listing for the pointer article is part of the
Borland Microcalc source code. Well, because of these and other
mistakes, all subscriptions to "Inside Turbo C" will begin anew
with the November issue. The first volume is considered trash
("When your new issue arrives, please throw your old ones
away."), and the November issue will be volume II, number 1.
According to Tim, the upcoming issues "will be outstanding in
every way." While that remains to be seen, a review of these
Issue C News 6
upcoming issues of "Inside Turbo C" will appear in an upcoming
issue of the "C News".
Issue C News 7
=================================================================
BEGINNERS CORNER by Wayne Dernoncourt
=================================================================
In the last column I discussed how to use pointers with the
"standard" functions found in almost all implementations
currently in use. This column is going to extend the discussion
of pointers with a discussion of just what pointers are and how
they operate.
Most computers operate with certain absolutes, that is,
there are things that will never change on a specific model or
brand of computer. In the case of an IBM PC compatible
computers, the system clock is at a specific location in memory,
as are the keyboard buffer and disk drive status locations
(there are others, but this is not intended to be a
comprehensive list, just a few examples). As a programmer you
will rarely, if ever, have to deal with these specific locations
-- there are operating system functions which you will use to
interact with these memory locations -- but they do exist.
You can imagine that even if you know the absolute address
of the memory location that you want to access, it would be
difficult to tell a compiler that whenever you access the
variable 'a', you want the computer to access a specific
location. In C this is handled through the mechanisms of
pointers, that is a way for a variable to 'point' to something
else. Since the addresses of the examples (the system clock,
keyboard buffer and disk drive status) are ones that never
change - you can use the C keyword "const" that says that these
addresses will never change and that an error is to be signaled
if your program ever tries to change the address. You can now
set a variable equal to the value pointed at by the pointer.
Let's go back to the example that we started using when
this series of articles first started off, that of finding the
average of 4 numbers. Again we're only going to modify one
module, the one called GETDATA. Everything else is going to
remain the same temporarily.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -