:: Re: [DNG] Learning C
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: tito
Fecha:  
A: dng
Asunto: Re: [DNG] Learning C
On Tue, 24 Sep 2024 08:51:19 -0500
o1bigtenor via Dng <dng@???> wrote:

> On Tue, Sep 24, 2024 at 7:44 AM Didier Kryn <kryn@???> wrote:
>
> > Le 24/09/2024 à 13:02, o1bigtenor via Dng a écrit :
> >
> >
> > Hmmmmm - - - so there are a whole pile of 'secret handshakes' and the
> > like in the learning of 'C' to necessitate the need for lessons - - -
> > that's
> > too bad. Having read many reports of poor quality C programming I am
> > somehow then even less impressed.
> > You're recommending a good book - - - - imo there are likely a
> > plethora of books - - - how does one determine which are good ones without
> > previous understanding? (Seriously - - - to accurately determine the
> > quality
> > of a didactic text takes expertise and when one is starting the learning
> > process what one is exactly short of is that - - - expertise!)
> >
> > Over to you for more information.
> >
> >     I learned K&R C language starting in 1980, by writing programs, with
> > an engineer at hand to answer my questions. ~10 years later I found an
> > excellent book edited by O'Reilly, but I probably gave it to someone who
> > did not give it back. Later I found at the same editor a book on both C and
> > C++, which was poor about C. This was before C99, but well after the advent
> > of ANSI C.

> >
> >     Today I'm not able to suggest a book. However I don't think it is
> > valuable to learn K&R C. ANSI C was a big improvement, and there has been
> > some other significant improvements since then, even if I don't know all of
> > them. I guess there are professional C programmers around there who can
> > suggest good books.

> >
> >     For what regards lessons on  programming languages, like in every
> > matter, I have experienced that the learning is faster *and better* with
> > lessons and tutorship, at least at the beginning. This is true for ski, and
> > for swimming, and is also true for programming. Why wouldn't it be?

> >
> >
> >
>
> Having suffered under far too many purportedly good sets of lessons (and
> tutorship) in
> technical areas and others I am somewhat loathe to accept the need for such
> with
> recommendations to at least good stuff.
> The lessons that I've found so far online seem to suffer from a huge
> inability to learn and
> a vast overconfidence in 'purdy pictures' to provide most of the
> instruction. Some of us
> learn by reading and doing without needing a plethora of videos (most often
> hard to follow)
> with precious little actual content.
>
> So - - - what lessons are recommended to actually get the job done?
>
> Regards


Write a program that:

accepts a file name as argument on the commandline and no more than one and prints a help text otherwise;
opens that file and locks it;
reads the file contents to a memory buffer;
ouput every character that is in prime number location up to the end of the file
and write the aforementioned characters to a new file that as name has the first
8 of this characters and a suffix of .txt making sure that you do not overwrite
any existing file. Clean up and free any allocated memory and close the program gracefully.

Ciao,
Tito