473,889 Members | 1,692 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
Dan Pop wrote:

<snip>
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...


I was talking about not trusting Adobe. You may think I am wrong not to
trust Adobe, and that this is a "false concern". That's up to you. But it's
for me to decide who /I/ will trust, rightly or wrongly. You can decide who
/you/ are going to trust, okay?

--
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 #121
In article <c0**********@s unnews.cern.ch> , Da*****@cern.ch says...
In <MP************ ************@ne ws.verizon.net> Randy Howard <ra*********@FO OverizonBAR.net > writes:
In article <c0**********@s unnews.cern.ch> , Da*****@cern.ch says...
Please elaborate. Which other pieces of Adobe software have bitten you
with their malicious code?


Perhaps a reminder that recently Adobe has gotten some flack for
introducing some "malware" into Acrobat reader that makes it
absolutely refuse to render certain graphic images, such as
US currency. No warning, no disclosure, it's just there. It
makes it load much, much slower while it scans the file looking
for such on each "fopen()".

Here is an example of such discussions:

http://www.pdfzone.com/news/767-PDFzone_news.html


Your example talks about Adobe Photoshop and the change in question does
not qualify as malicious code.


You're absolutely right. Sorry, I crossed up two different huge,
bloated, Adobe software packages in my head. I suppose it's only a
matter of time before it bleeds over into Acrobat, but for now it
seems not to be.
--
Randy Howard
2reply remove FOOBAR

Nov 14 '05 #122
On Fri, 13 Feb 2004 01:21:10 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
On Wed, 11 Feb 2004 20:31:36 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
You see, text fits in with the C model very well indeed. It's easy to
write text processors in C.
Its also easy to write pdf readers in standard C.


Really?


Yes, really.
Show me.
Sure, for Eur 150/hour. :-)
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.


As it happens, this is ludicrously easy. You need to think a little harder.

By the way, where did I mention that you could use only the first 24 pages
of K&R? If you choose to introduce artificial restrictions, then thats your
lookout.

--
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 #123
On Fri, 13 Feb 2004 19:38:11 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
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.
??? 1.13 asks me to return the lower case of the program's input, or the
input unmodified, should that not be a letter.

but your one (1.12) is just as easy. I'll define a word break as any
whitespace character in the input, and off I go.
If pdf processing is so
easy, he shouldn't find this to be a major challenge.
Its not.
But perhaps he has to
open a file or something, in which case I agree that the restriction would
be a bit harsh.
Pipe is your friend. After all, you can't process a text /file/ via the
same program without it.
But 1-13 is a different matter.


Its certainly a good attempt to change the subject from file readers to
something totally different. Nice try.

--
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 #124
Mark McIntyre wrote:
On Fri, 13 Feb 2004 01:21:10 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
On Wed, 11 Feb 2004 20:31:36 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:

You see, text fits in with the C model very well indeed. It's easy to
write text processors in C.

Its also easy to write pdf readers in standard C.
Really?


Yes, really.
Show me.


Sure, for Eur 150/hour. :-)


Then it can hardly be as easy as you claim.

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.


As it happens, this is ludicrously easy.


Prove it.
You need to think a little harder.
Nope. You are the one making the claim (that PDF processing is as easy as
text processing).

By the way, where did I mention that you could use only the first 24 pages
of K&R?


You didn't, but you said that PDF processing was as easy as text processing,
and I can solve K&R 1-13 using only the information presented in the first
24 pages of K&R. Still, as you say, it's quite an arbitrary restriction, so
I don't insist on it as long as the program remains relatively simple.
--
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 #125
Mark McIntyre wrote:
On Fri, 13 Feb 2004 19:38:11 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
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.
??? 1.13 asks me to return the lower case of the program's input, or the
input unmodified, should that not be a letter.


Would this be the Mark McIntyre edition of K&R2, then?

K&R2, page 24: "Exercise 1-13. Write a program to print a histogram of the
lengths of words in its input..."
but your one (1.12) is just as easy. I'll define a word break as any
whitespace character in the input, and off I go.
Ex 1-12 asks you to print one word per line. Okay, so you say it's easy. So
why not demonstrate that it's easy?
If pdf processing is so
easy, he shouldn't find this to be a major challenge.
Its not.


Prove it.

But perhaps he has to
open a file or something, in which case I agree that the restriction would
be a bit harsh.


Pipe is your friend. After all, you can't process a text /file/ via the
same program without it.
But 1-13 is a different matter.


Its certainly a good attempt to change the subject from file readers to
something totally different. Nice try.


Excuse me? It's not totally different /at all/. What's the matter - is it
suddenly hard to process PDF files? I thought you said it wasn't.

But okay, if you /think/ it's different, just show me a cat for PDF.
Presumably that's easy too, right?

--
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 #126
nrk
Richard Heathfield wrote:
Mark McIntyre wrote:
On Fri, 13 Feb 2004 19:38:11 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
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.


??? 1.13 asks me to return the lower case of the program's input, or the
input unmodified, should that not be a letter.


Would this be the Mark McIntyre edition of K&R2, then?

K&R2, page 24: "Exercise 1-13. Write a program to print a histogram of the
lengths of words in its input..."
but your one (1.12) is just as easy. I'll define a word break as any
whitespace character in the input, and off I go.


Ex 1-12 asks you to print one word per line. Okay, so you say it's easy.
So why not demonstrate that it's easy?
If pdf processing is so
easy, he shouldn't find this to be a major challenge.


Its not.


Prove it.

But perhaps he has to
open a file or something, in which case I agree that the restriction
would be a bit harsh.


Pipe is your friend. After all, you can't process a text /file/ via the
same program without it.
But 1-13 is a different matter.


Its certainly a good attempt to change the subject from file readers to
something totally different. Nice try.


Excuse me? It's not totally different /at all/. What's the matter - is it
suddenly hard to process PDF files? I thought you said it wasn't.

But okay, if you /think/ it's different, just show me a cat for PDF.
Presumably that's easy too, right?

Actually, its not all that hard.

system("pdftote xt file.pdf");
system("cat file.txt");

Smile. It's supposed to be funny. Seriously though, there is a utility
called pdftotext. It doesn't really do a great job in terms of rendering
readable text from pdf, but for purposes of solving the proposed exercise,
it should be enough to use this and pipe the output through your standard C
solution for text files :-)

-nrk.
--
Remove devnull for email
Nov 14 '05 #127
On Sat, 14 Feb 2004 05:46:00 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:

Sure, for Eur 150/hour. :-)
Then it can hardly be as easy as you claim.


No, thats just my hourly rate for answering homework questions. if you
charge less, then maybe you can write it, sell it to me and I'll sell it
back to you at my rate... :-)
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 .


As it happens, this is ludicrously easy.


Prove it.


Golly, prove that you can convert uppercase characters in a stream of data
into lowercase ones using only standard C? oooo thats tricky....
You need to think a little harder.
Nope. You are the one making the claim (that PDF processing is as easy as
text processing).


Indeed. But thats not what you asked me to do. You asked me to solve K&R2
1.13. Now in my copy thats
"write a program to convert its input to lower case, using a function
lower(c) which returns c if c is not a letter, and the lower case value of
c if it is a letter"
By the way, where did I mention that you could use only the first 24 pages
of K&R?


You didn't, but you said that PDF processing was as easy as text processing,
and I can solve K&R 1-13 using only the information presented in the first
24 pages of K&R.


Terriffic.
Still, as you say, it's quite an arbitrary restriction, so
I don't insist on it as long as the program remains relatively simple.


You'll have to point out where I said it would be a simple /program/. I
said that it was simple to /write/ a program. Call me a pedant if you
like.
--
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 #128
On Sat, 14 Feb 2004 05:55:59 +0000 (UTC), in comp.lang.c , Richard
Heathfield <do******@addre ss.co.uk.invali d> wrote:
Mark McIntyre wrote:
but your one (1.12) is just as easy. I'll define a word break as any
whitespace character in the input, and off I go.
Ex 1-12 asks you to print one word per line. Okay, so you say it's easy. So
why not demonstrate that it's easy?


*sigh*

Are you clinically thick on this point? Here's the algo, you go implement
it.

assumptions
1) whitespace defines the end of a word.
2) there exists a file containing the data to process

read file char by char till find whitespace
print out whats been found so far
print out a newline
repeat search till end of file
Its certainly a good attempt to change the subject from file readers to
something totally different. Nice try.


Excuse me? It's not totally different /at all/.


Let me see:
I was talking about writing a file reader for pdfs in standard C.
You wanted me to answer some K&R exercise using only a subset of standard
C.

I'm struggling to spot the similarity here.
What's the matter - is it
suddenly hard to process PDF files? I thought you said it wasn't.
But okay, if you /think/ it's different, just show me a cat for PDF.
Presumably that's easy too, right?


Yup. You really are being clinically thick, aren't you?

--
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 #129
On Sat, 14 Feb 2004 21:35:07 GMT, in comp.lang.c , nrk
<ra*********@de vnull.verizon.n et> wrote:
Richard Heathfield wrote:
Mark McIntyre wrote:
RJH wrote
If pdf processing is so
easy, he shouldn't find this to be a major challenge.

Its not.


Prove it.

Actually, its not all that hard.

system("pdftote xt file.pdf");
system("cat file.txt");

Smile. It's supposed to be funny. Seriously though, there is a utility
called pdftotext.


Oh, rats, you spoiled it.

Richard. Read back through my posts. See if you can spot where I said I
intended to convert the pdf into cutsey graphical output... my proposed
reader does nothing more sophisticated than determine the words in the pdf,
and print them to stdout.

I'm sorry, I've been taking the p*ss. But you deserved it, getting all on
your high horse about pdf being nonportable, you don't trust commercial
vendors etc. You've behaved like the worst sort of linuxhead geek mole,
obsessed with the idea that anything commercial is of necessity filled with
spyware, viruses and bad code, whereas free software simply *must* be
safe, reliable, and honest. And I *know* you're not like that at all
really.
--
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 #130

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
11203
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
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...
1
10896
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
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...
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.

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.