473,889 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A C tutorial

There is a C tutorial at
http://www.cs.virginia.edu/~lcc-win32
It is written to go with the compiler, available
at the same URL.

I have added quite a bit of material, and I would be
glad if people in this group give it a try and tell me if
I am saying nonsense somewhere.

Beware that I am not very orthodox, hence my tutorial
(and the associated compiler) is not just a tutorial about
ANSI C, but covers things like operator overloading and
other heresies :-)

And since it is running in a specific OS, windows
programming makes for quite a lot of pages. If you
use another OS however, the first part is (almost)
straight C.

jacob

Nov 14 '05
156 7754
Richard Bos wrote:
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Richard Bos wrote:
> I refer in particular to their comments about -pedantic.


What about those comments? As long as they provide conformance, they can
be as rude as they like about it, can't they?


They can, but it does degrade my confidence in them having _my_
interests at heart. I don't want to be embraced-and-extended by them any
more than by M$, and they _do_ want to embrace-and-extend me.


That's a reasonable position for you to hold. Still, they /do/ provide
conformance, and at a price that's hard to beat. I agree that it would be
better if they could be a little more gracious about it, but one can't have
everything.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #111
Richard Heathfield <in*****@addres s.co.uk.invalid > wrote:
Richard Bos wrote:
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Richard Bos wrote:

> I refer in particular to their comments about -pedantic.

What about those comments? As long as they provide conformance, they can
be as rude as they like about it, can't they?


They can, but it does degrade my confidence in them having _my_
interests at heart. I don't want to be embraced-and-extended by them any
more than by M$, and they _do_ want to embrace-and-extend me.


That's a reasonable position for you to hold. Still, they /do/ provide
conformance, and at a price that's hard to beat. I agree that it would be
better if they could be a little more gracious about it, but one can't have
everything.


Oh, I don't say that I trust them any less than the commercial
competition; in fact, I'm not even saying that I don't trust them
somewhat more. All I'm saying is that I certainly don't entirely trust
them either.

Richard
Nov 14 '05 #112
In <c0**********@h ercules.btinter net.com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Dan Pop wrote:
In <c0**********@s parta.btinterne t.com> Richard Heathfield
<do******@addre ss.co.uk.invali d> writes:
Dan Pop wrote:

My claim is that gcc is the ideal target for such an attack. If, from
my claim you infer that you have no reason not to blindly trust gcc,
then
fine. But then, you'll look like the king of the hypocrites when
claiming that you distrust software you cannot check for malicious code
(an attacked gcc is a piece of software you cannot check for malicious
code, even if the sources are available, as long as you use gcc to
rebuild the program).

King of the hypocrites? No, not really. You see, I don't distrust GNU. But
I /do/ distrust Adobe. I am confident of GNU's good intentions. I am not
confident of Adobe's good intentions.


Non sequitur and a proof that you have understood nothing of this issue.


I think we're talking about different issues. Feel free to continue
discussing the one that concerns you, if you must.


I was talking about the one you claimed it concerned you: malicious code
in your utilities. It seems that, after all, it was a false concern...

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #113
In <c0**********@h ercules.btinter net.com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Richard Bos wrote:
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:

> But software Y, which
> coincidentally happens to be commercially produced, you don't trust,
> for precisely the same reason.

No. I trust gcc partly because of the million eyes, but mainly because I
firmly believe that GNU have the interests of the programming community
at heart.


You _have_ read the GCC man pages, haven't you?


Yes.
I refer in particular to
their comments about -pedantic.


What about those comments? As long as they provide conformance, they can be
as rude as they like about it, can't they?


The problem is that, to the beginner, the name of the -pedantic flag is
very misleading. Which is why we seldom see such people using it, even
if they use -ansi. If the GNU C people were entirely honest, -ansi would
have included the functionality of -pedantic. There is no point in using
two flags for achieving exactly one goal and I'm not aware of any compiler
that requires more than one flag for becoming standard conforming.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #114
In <c0**********@h ercules.btinter net.com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Dan Pop wrote:

<snip>
These days, text means more than whatever can be expressed with the
ASCII character set.


Who said anything about ASCII?


Your examples implied that the base character set of the implementation
is good enough for any text-based utility. Replace ASCII by EBCDIC or
any other character set used as the base character set of common C
implementations .

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #115
In <c0**********@t itan.btinternet .com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Mark McIntyre wrote:
Its also easy to write pdf readers in standard C.


Really? Show me. For example, please solve exercise 1-13 in K&R2, using a
PDF file instead of a text file as input. Please restrict yourself to those
parts of C introduced in those first 24 pages, to make it a fair
comparison.


Your idea about "fair" comparisons is heavily screwed. He wrote "standard
C", not the subset of the language documented in the first 24 pages of
K&R2.

BTW, I chanllenge you to write a fully functional text reader
(e.g. having the basic features of the open source "less") using only
that subset of the language.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #116
In <40******@news2 .power.net.uk> Richard Heathfield <in*****@addres s.co.uk.invalid > writes:
Richard Bos wrote:
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Richard Bos wrote:

> I refer in particular to their comments about -pedantic.

What about those comments? As long as they provide conformance, they can
be as rude as they like about it, can't they?
They can, but it does degrade my confidence in them having _my_
interests at heart. I don't want to be embraced-and-extended by them any
more than by M$, and they _do_ want to embrace-and-extend me.


That's a reasonable position for you to hold. Still, they /do/ provide
conformance,


The past tense fits better here: they *did* provide conformace.
and at a price that's hard to beat. I agree that it would be
better if they could be a little more gracious about it, but one can't have
everything.


Apparently, not even conformance to the current C standard... Which
reinforces Richard Bos' statement about the GNU C people not having the
interests of the C programming community at heart.

For the record, I do consider GNU C better than any C standard. It
provides badly needed features that the standardisation committee
preferred to ignore (e.g. the concept of pure functions, typeof or blocks
returning/yielding a value). But this is no excuse for providing
improper support for standard C.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #117
Da*****@cern.ch (Dan Pop) writes:
Apparently, not even conformance to the current C standard... Which
reinforces Richard Bos' statement about the GNU C people not having the
interests of the C programming community at heart.
Not too surprisingly, the companies paying for GCC development have
primarily the interests of their customers at heart.
For the record, I do consider GNU C better than any C standard. It
provides badly needed features that the standardisation committee
preferred to ignore (e.g. the concept of pure functions, typeof or
blocks returning/yielding a value). But this is no excuse for
providing improper support for standard C.


If you paid for GCC, you should complain to the company from which you
bought GCC and/or GCC support. The timescale and order in which things
get implemented in GCC is definitely influenced by the wishes of the
customers, and apparently C99 conformance is not a priority to many
customers.

Although I regret this, I'm not in a position to complain (and the GCC
developers don't owe me an excuse), since I didn't pay for GCC.

Martin
Nov 14 '05 #118
Dan Pop wrote:
In <c0**********@t itan.btinternet .com> Richard Heathfield
<do******@addre ss.co.uk.invali d> writes:
Mark McIntyre wrote:
Its also easy to write pdf readers in standard C.
Really? Show me. For example, please solve exercise 1-13 in K&R2, using a
PDF file instead of a text file as input. Please restrict yourself to
those parts of C introduced in those first 24 pages, to make it a fair
comparison.


Your idea about "fair" comparisons is heavily screwed. He wrote "standard
C", not the subset of the language documented in the first 24 pages of
K&R2.


Yes, he did, but it's not as if I'm asking him to write a full reader. Just
a simple little word-length histogram program. If pdf processing is so
easy, he shouldn't find this to be a major challenge. But perhaps he has to
open a file or something, in which case I agree that the restriction would
be a bit harsh. But let's at least see a program written in "simple" C -
the kind a newbie can understand - that can process PDF files in some
relatively trivial way such as word-length histograms. I don't think this
is an unreasonable thing to ask if Mark's claim is accurate.
BTW, I chanllenge you to write a fully functional text reader
(e.g. having the basic features of the open source "less") using only
that subset of the language.


I have not claimed that I can do this (in fact, the absence of full screen
video in standard C makes it impossible to do portably, as any newbie ought
to know). But 1-13 is a different matter.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #119
Dan Pop wrote:
Your examples implied that the base character set of the implementation
is good enough for any text-based utility.


It's sufficient for clear communication to occur, yes.

It would be different if the target medium were paper (e.g. for a book, a
magazine article, or whatever); in those circumstances, it's appropriate to
use, say, PostScript or even PDF, or basically whatever the publishers want
- after all, they're the ones that have to print it. But when publishing
material on the Net, I see no reason arbitrarily to restrict one's audience
by choosing esoteric file formats.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 14 '05 #120

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2936
by: Rhino | last post by:
Can anyone point me to a good free XSLT Tutorial online? I looked for some a few months ago and didn't find anything very good. I'm hoping some of the experts here can point me to a good XSLT tutorial..... -- Rhino --- rhino1 AT sympatico DOT ca "There are two ways of constructing a software design. One way is to make it
15
4246
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
18
1970
by: Xah Lee | last post by:
i've started to read python tutorial recently. http://python.org/doc/2.3.4/tut/tut.html Here are some quick critique: quick example: If the input string is too long, they don't truncate it, but return it unchanged; this will mess up your column lay-out but that's usually better than the alternative, which would be lying about a value. (If you really want truncation you can always add a slice operation, as in
0
1789
by: Joe Mayo | last post by:
I've recently updated the C# Tutorial at C# Station with a new addition, Lesson 17: Enums. The C# Tutorial may be found at http://www.csharp-station.com/Tutorial.aspx. Other updates include: 1. Downloadable source code. 2. All example programs run on-line as NTD apps. 3. A support forum for discussing the Tutorial.
10
3098
by: Safalra | last post by:
When a poster in a forum I frequent said they were beginning to learn HTML, I thought I should direct them to a good HTML tutorial so that they wouldn't start using <blink> and the like. Remembering that this group has discussed HTML tutorials several times in the past, I searched the Google Groups archives, but all I can find are tutorials unfortunately demonstrating Flavell's Law. Searching the internet, the only accurate tutorials for...
11
2945
by: Magnus Lycka | last post by:
While the official Python Tutorial has served its purpose well, keeping it up to date is hardly anyones top priority, and there are others who passionately create really good Python tutorials on the web. I think 'A Byte of Python' by Swaroop C H is a good beginners tutorial, and 'Dive Into Python' by Mark Pilgrim is a good tutorial for more experienced programmers.
7
2262
by: Turbo | last post by:
I have a written a detailed html tutorial here:- http://sandy007smarty.seo.iitm.ac.in/2006/09/26/html-tutorial/ I know there are a couple of html tutorials out there. But its a tutorial without links!! Everything in one page. Please leave a comment if you like it.
2
2114
by: sara | last post by:
Hi All, I learned C++ long time ago and now I want to review all of its details in a short time like a week. I wonder if there is a good tutorial you know which I can read for this purpose. Thanks a lot.
0
9969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9810
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10794
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9612
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7999
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6029
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4650
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.