473,889 Members | 1,734 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 7753
Dan Pop wrote:
In <c0**********@t itan.btinternet .com> Richard Heathfield
<do******@addre ss.co.uk.invali d> writes:
Dan Pop wrote:
In <c0**********@t itan.btinternet .com> Richard Heathfield
<do******@addre ss.co.uk.invali d> writes:

jacob navia wrote:

> But PDF is a widely used format,

Oh, I know, I know. That doesn't mean it necessarily /should/ be.

Name one document format with a public specification that should be
used instead, allowing for comparable quality of the printed output.
And explain why that format should be used instead of PDF.


Text works for me. No public spec needed; if there's anyone out there who
doesn't know what text is, I probably don't want to read their stuff
anyway.

As for the printed output, it looks pretty good from where I'm standing.
If your text printout quality is low, consider investing in a better
printer.


Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.


That's tricky, because the quality obtained from PDF documents is so low.
Here's an example:

~I~R_^U~Pp> 7
~P$~@N` ~B^S~Sm^U^O ~R~C8!^@}z~Z ^_~G?y+d \^?fw1^R
-.~I:^?q~RV~C 2D~U,C%|^Rz `,~XS;I w"^]XI^R^_?eqa#]'v^L6|
HQ^X^^~^U/^V~GpA=^G~H Z^GTl6W~L^ ^`|^T~H
C^Y~C?t3^U ^E^C1~Vz^Q Fj~SM~Q~X w^RǵmH^N!XH }~Kyt0^CFTz~N lE
cx.hjAA$| O?~B^S~]Y;0H$TEC~I^K 0
~U?~W ~I|"@~Gd^V /^Q~X^An~].N~V&<Y^A^ DѬ^G~G7*
FQ~M?I~La^H iedJ^]^W~_~H~BS^ ^X ]^S~DU^G~\%e 1o^XF~SV
I can't manage anything quite so bad using text, I'm afraid.
--
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 #61
Da*****@cern.ch (Dan Pop) writes:
In <c0************ *@news.t-online.com> Martin Dickopp <ex************ ****@zero-based.org> writes:
Da*****@cern. ch (Dan Pop) writes:
In <c0************ *@news.t-online.com> Martin Dickopp <ex************ ****@zero-based.org> writes:

Da*****@cer n.ch (Dan Pop) writes:

> In <c0*********@he rcules.btintern et.com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
>
>>Mark McIntyre wrote:
>>
>>> BTW I bet you a groat you don't scan most programs for malicious code,
>>> so your argument is spurious.
>>
>>I disagree that the argument is spurious. It's true that I don't scan most
>>program s for malicious code; I don't have to, because - since they're Open
>>Source - lots of people have done this already,
>
> How do you know it? If everyone reasons like you, no one is actually
> doing it :-) ^^

For the record, I often read the source code of Free Software, which
disproves that /no one/ is doing it. :) ^^^^^
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^
Do you know what "if" means in English?


Suffice it to say that what I wrote contains no indication that I don't.
If you disagree, please be more elaborate.


Reread the underlined text above and explain what it was supposed to
mean.


The underlined text is not a complete sentence and was therefore not
supposed to mean anything by itself. Only the whole sentence was
supposed to have meaning.

Martin
Nov 14 '05 #62
On Tue, 10 Feb 2004 20:33:35 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:

Not trying to be difficult, but if you can define "text" then I'll feel
happier.


See 5.2.1 of C99 (Character sets).


This defines "character sets", not "text". If you consider the two to be
synonyms then you presumably consider all non-English text documents to be
non-text. I'd call you a rude name at that point, but then we could invoke
godwin... :-)

Anyway, I was fully expecting 7.19.2....

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #63
On Tue, 10 Feb 2004 20:47:54 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Dan Pop wrote:
Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.
That's tricky, because the quality obtained from PDF documents is so low.


for pathological definitions of "low".
Here's an example:
Just because you can't read it, doesn't mean its not high quality.

Or do you claim that because your C code is converted from "text" to
"binary" then by definition it is poor quality? :-)
I can't manage anything quite so bad using text,


You're simply not trying hard enough.

And by the way, that /was/ text....

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #64


Dan Pop wrote:
[snip}

There is a nice paper by Ken Thompson, proving that such scans cannot
guarantee a lack of malicious code being included in the application,
unless you have assembled your own compiler. He had included a backdoor
in Unix via the C compiler and no matter how carefully you'd study the
source code of the C compiler, that you could use to rebuild the compiler
from the sources, you'd see nothing because there was nothing left in the
source code. The malicious code was inside the executable of the compiler
that was coming with the system and it would reproduce itself in the
binaries of the clean compiler you'd compile with that compiler.

Dan


I was wondering when someone would bring up the Thompson paper
in this thread :)

--

"It is impossible to make anything foolproof because fools are so
ingenious" - A. Bloch

Nov 14 '05 #65
Mark McIntyre wrote:
On Tue, 10 Feb 2004 20:33:35 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:

Not trying to be difficult, but if you can define "text" then I'll feel
happier.
See 5.2.1 of C99 (Character sets).


This defines "character sets", not "text".


This seemed to me to be sufficient.
If you consider the two to be synonyms
Not really, but I consider one to be built out of the other, pretty much.
I'm not silly about it, though; I would be perfectly prepared to accept
common extensions, such as @ and $ (both available in both ASCII and
EBCDIC).
then you presumably consider all non-English text documents to be
non-text.
Not so. For example, I consider C programs to be text documents, and they
are most certainly not written in English.
I'd call you a rude name at that point, but then we could invoke
godwin... :-)
If you were to call me a rude name at that point, I suspect it would be
because of your misunderstandin g of my position, rather than because of my
actual position.
Anyway, I was fully expecting 7.19.2....


That is another good expression of my point, yes.

--
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 #66
Mark McIntyre wrote:
On Tue, 10 Feb 2004 20:47:54 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Dan Pop wrote:
Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.
That's tricky, because the quality obtained from PDF documents is so low.


for pathological definitions of "low".


<shrug> It is claimed that PDF documents are in a portable document format.
That's what PDF /stands for/. And yet PDF is clearly /not/ a portable
format, requiring as it does special readers which are not available on all
platforms.
Here's an example:
Just because you can't read it, doesn't mean its not high quality.


Well, it doesn't mean it's not of high quality from someone else's point of
view. I will agree with you thus far. But from /my/ point of view, if I
can't read it, it's useless. Useless *to me*, that is.

Or do you claim that because your C code is converted from "text" to
"binary" then by definition it is poor quality? :-)
No, but then I don't claim that my C compiler produces portable documents,
either.
I can't manage anything quite so bad using text,
You're simply not trying hard enough.


I don't say other people can't manage anything quite so bad. :-)

And by the way, that /was/ text....


To you, perhaps. Not to me.

--
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 #67
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Dan Pop wrote:
There is a nice paper by Ken Thompson,


I know. I don't have a problem trusting gcc.


Besides, given the existence of other, if necessary self-designed,
languages, Thompson's reflections are not as significant as they appear
at first sight.

Richard
Nov 14 '05 #68
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
On Tue, 10 Feb 2004 20:47:54 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Dan Pop wrote:

Show us how you can use the plain text format to display a complex
mathematical formula or the picture of your cat (dog, whatever)
with a quality comparable to that obtained from a PDF document.

That's tricky, because the quality obtained from PDF documents is so low.


for pathological definitions of "low".


<shrug> It is claimed that PDF documents are in a portable document format.
That's what PDF /stands for/. And yet PDF is clearly /not/ a portable
format, requiring as it does special readers which are not available on all
platforms.


You can write your own reader, if you wish. There are systems without
HTML readers, but few people would call HTML unportable, because it is
at least possible to write an HTML reader for just about any platform;
the same thing should be true for PDF.
Hell, if you're satisfied with a plain-text representation, a PDF reader
could even be on-topic in c.l.c :-)

Richard
Nov 14 '05 #69
In <c0**********@s parta.btinterne t.com> Richard Heathfield <do******@addre ss.co.uk.invali d> writes:
Dan Pop wrote:
In <c0**********@t itan.btinternet .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:
>
>> OTOH, Acrobat Reader lets you copy/paste, generates excellent output
>> and is trivially easy to use.
>
>Is the source code freely available, so that I can assure myself that
>the program contains no malicious code?

On how much of the software you're currently using have you already
performed this check?

(a) Non sequitur. If the source is available then I can, if I wish,
perform this check. Whether I then choose to do so is entirely up to me.


Nope, it's not a non sequitur: if you don't perform such scans, the
ability to perform them becomes irrelevant.
(b) Even though it's a non sequitur, I'll answer it. I have performed this
check on /some/ of the software I use, but not all.


Therefore, you have no a priori reason to reject Acrobat Reader:


Yes, I do.


Please elaborate. Which other pieces of Adobe software have bitten you
with their malicious code?
you're
already using software you haven't scanned.


But I'm not using /Adobe/ software that I haven't scanned.


Why?
There is a nice paper by Ken Thompson,


I know. I don't have a problem trusting gcc.


On the contrary, gcc is the ideal target for pulling such a trick,
precisely because its code is widely available and most people use gcc
to build gcc.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #70

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
9967
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
11202
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10792
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...
1
10895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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
5830
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
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
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.