Introduction:
-------------
This is a list of a few C and C++ language tutorials available to a
user. This list includes interactive tutorials, public-domain code
collections, books etc. I've developed this FAQ purely as a volunteer
effort as a service to the Internet community. Although every effort
has been made to insure that all the information here is as accurate as
possible, no guarantee is implied or intended.
I welcome comments, suggestions or criticism for all the people out
there on the net that read this. If you can help me make this list a
little better, you will be helping a lot of people out there on the
net. I am a horrible writer and an even worse speller. If you find
any errors or would like to suggest any additions please feel free to
email me at the address below:
carpenterv@vms.csd.mu.edu
What's new in this issue:
-------------------------
This section of the document will point out all the new additions,
corrections, updates etc. If there is enough interest, I will start
producing a 'diff' version.
1. Added a second web server that has the HTML and PS version of this
document.
2. Updated the information on the 'C++ on the WWW'. The address has
of the web server has changes. The author also converted Dordill's
C++ course to HTML which is online.
3. Updated the information in the MSDOS/Windows compiler section.
4. Added a new item called `Programming in C' that contains a great
collection of C and programming items.
5. Updated the information on the C++ FAQ.
6. Added a lot of information on OS/2. (Joe Dougherty)
7. Added more information about Scott Meyers new book titled "More
Effective C++".
8. Updated the oak.oakland.edu info and the directory structure has
been changed.
9. Update the information on the C Snippets packages. The author
released a new package that includes 400+ files.
I am switching to URL in place of the standard ftp and filename format.
URL stands for "Uniform Resource Locator". Think of it as a networked
extension of the standard filename concept: not only can you point to a
file in a directory, but that file and that directory can exist on any
machine on the network, can be served via any of several different
methods, and might not even be something as simple as a file: URLs can
also point to queries, documents stored deep within databases, the
results of a finger or archie command, or whatever.
File URL:
---------
file://oak.oakland.edu/simtel/msdos/c/00_index.txt
Gopher URL:
-----------
To connect to a particular gopher server, use this URL:
gopher://gopher.tc.umn.edu/
News URL:
---------
To point to a Usenet Newsgroups, the URL is simply:
news:comp.lang.c
HTTP URL:
---------
HTTP stands for HyperText Transport Protocol. HTTP servers are
commonly used for serving hypertext documents
http://vinny.csd.mu.edu
This file is posted on the 1st and the 15th of each month to the Usenet
Newsgroups COMP.LANG.C, COMP.LANG.C.MODERATED, COMP.LANG.C++,
NEWS.ANSWERS & COMP.ANSWERS. The HTML and postscript version of this
documents are available. Here's the URL:
http://vinny.csd.mu.edu
NOTE: This is my Linux PC that does get inundated with request. The
last time I checked the stats, there were about 27 connections every
minute. If you get timed out, please try again. The most recently
posted version of this document is kept on the news.answers archive on
rtfm.mit.edu. You can receive it via anonymous ftp. The URL is listed
below.
ftp://rtfm.mit.edu/pub/usenet/news.answers/C-faq/learn-c-cpp-today
If you don't have access to ftp, you can also receive this file via
e-mail by sending mail to mail-server@rtfm.mit.edu with:
send /pub/usenet/news.answers/C-faq/learn-c-cpp-today
in the body (not subject line) of your message. You can also receive
the latest version via electronic mail by e-mailing me.
To: learncpp@vinny.csd.mu.edu
Subject: send learn-c-cpp-today
Body: ignored. Can be blank.
A lot of tutorials discussed here are available via anonymous ftp. If
you don't have ftp, you can also retrieve these files via a ftp-email
gateway. To retrieve files via e-mail, send mail to
ftpmail@decwrl.dec.com with the command HELP in the body of the message
to receive a complete list of all commands. A typical message would
look something like this:
connect oak.oakland.edu
chdir /simtel/msdos/c
binary
uuencode
get xxx.zip
quit
Some of the items discussed here are platform-dependent, but most of
the items are applicable across all platforms (portable). If you have
any comments, suggestions, complaints, additions, etc, please feel free
to e-mail me at the following address:
carpenterv@vms.csd.mu.edu
If you are working on a tutorial or would like something added to this
list, please e-mail me at the address given above.
The Origins of C and C++:
-------------------------
The 'C' programming language was originally developed for and
implemented on the UNIX operating system, on a DEC PDP-11 by Dennis
Ritchie. One of the best features of C is that it is not tied to any
particular hardware or system. This makes it easy for a user to write
programs that will run without any changes on practically all machines.
C is often called a middle-level computer language as it combines the
elements of high-level languages with the functionalism of assembly
language.
C allows the manipulation of bits, bytes and addresses- the basic
elements with which the computer functions. Another good point about C
is its portability which makes it possible to adapt software written
for one type of computer to another. C was created, influenced, and
field tested by working programmers. The end result is that C gives
the programmer what the programmer wants. C offers the speed of
assembly language and the extensibility of FORTH, but few of the
restrictions of Pascal and Modula-2.
C++ is an enhanced version of the C language. C++ includes everything
that is part of C and adds support for object-oriented programming
(OOP). In addition, C++ also contains many improvements and features
that make it a "better C", independent of object oriented programming.
C++ is actually an extendible language since we can define new types in
such a way that they act just like the predefined types which are part
of the standard language.
If you just use C++ as a better C, you will not be using all of its
power. Like any quality tool, C++ must be used the way it was designed
to be used to exploit its richness. Some of the new features include
encapsulation, inline function calls, overloading operators,
inheritance and polymorphism. I am not going to explain what they mean
here as that would simply take me away from my purpose here, but you
can refer to any good C++ book or the C++ FAQ (Item 7) for more
information.
What do you need to get started?
--------------------------------
The first thing you need is a compiler. A compiler reads the entire
program and converts it into object code, which is a translation of the
program source code into a form that the computer can execute directly.
UNIX SYSTEM:
Type cc at the % prompt. If you don't get any error messages, you
probably have a C compiler . If you get an error message, try acc, gcc
or g++. If any of these don't work, contact your local system
administrator and ask him/her to get you a C/C++ compiler. GNU C/C++
compiler is available from a lot of anonymous ftp sites free of charge.
Look into it. (I've got g++ running on my Linux box without any
problems)
MSDOS/Windows/OS2/Linux (IBM COMPATIBLES):
There are a lot of good compilers available to you. Microsoft Quick C
and Borland Turbo C/C++ are both good products for beginners. You can
buy both of them for under $50.00. I use Microsoft Quick C and
MS-Visual C/C++, and I prefer Quick-C for all my DOS programs as it is
small, and yet very powerful. Most of my programming is now on my
Linux PC with gcc/g++. (If you want a great 32 bit operating system,
you should look into Linux. E-mail me for details). You can also get
the DOS port of GNU C/C++ called DJGPP from oak.oakland.edu
/simtel/vendors/djgpp.
The increased popularity of OS/2 and it's latest incarnation Warp, has
provided programmers with a wider selection of compilers and
programming tools. Still available for free is the GNU gcc package
under the name emx. Emx integrates nicely with the Extended Editor
included with OS/2. It's available on ftp.cdrom.com, hobbes.nmsu.edu,
and other sites. IBM provides the CSet++ 2.x, as well as a smaller,
less-expensive package on CD-ROM called CSet++ First Step. Other
popular compilers include Borland C++ 1.0 for OS/2, and Watcom C/C++
for OS/2 10.0, and CA-C++ for OS/2 from Computer Associates.
OpenVMS (VAX & AXP)
If you're on a VAX, type in CC to check and see if you have a C
compiler. VAX C is not the best compiler around, but it certainly does
the job. If you don't have a C compiler, look into the GNU C/C++
compiler GCC. You can get the VAX version of GCC from ftp.spc.edu via
anonymous ftp. If on a AXP system, you should have access to DEC
C/C++. Please contact your local system administrator or computer
consultant for more site specific questions.
Macintosh (Apple/PowerMac)
There are three main players in the Mac compiler market: MPW (from
Apple), THINK C / Symantec C++ (both from Symantec), or CodeWarrior
(from Metrowerks): THINK C is $225 (only a C compiler), while Symantec
C++ is $375 (includes C and C++ compilers). CodeWarrior comes in two
versions: bronze and gold, at $199/299/399, respectively. The Symantec
C++ compiler (ver 8.0) is PowerMac native. Symantec and Metrowerks
offer academic pricing on their products which are substantially less
than the commercial prices.
There have been two attempts at freeware/shareware Mac C compilers:
Sesame C and Harvest. Harvest C was an ambitious attempt at a
production-quality freeware compiler which was later abandoned by the
author.
0 komentar:
Post a Comment