TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Roy J. Tellason
date: 2004-01-13 20:17:42
subject: [C] An interesting question

Pascal Schmidt wrote in a message to Roy J. Tellason:

 PS> Hi Roy! :-)

 RJT> I have a lot to learn about programming on that platform,  any 
 RJT> suggestions as to what might be some good places to start?

 PS> I cannot even tell you how *I* learned it. I guess I mostly just
 PS> read newsgroups discussions and read some sources for programs that
 PS> interested me.

I've looked at a bit of source,  and they seem to throw all sorts of things
in there that I never would have thought of.

 PS> I could program before, just in other languages.

I don't claim any particular expertise,  but I feel competent enough in c
to sit down and make something work,  if I wanted to do that.  Sometimes I
can read a source file and understand what's going on,  sometimes I can't, 
but that depends as much on the style of the writer as it does on what's in
the code.  I started messing with c under CP/M!  Got the Mix C compiler for
that platform,  as well as having (the extremely limited) small-c.  Got Mix
C and then Power C for dos.  I've also since then acquired copies of both
msc6 and tc (?) but haven't done much of anything with them.

One of the things that bugged me back in those days was all of the
platform-specific stuff then,  things like "find out what kind of a
monitor and video subsystem is in the box we're running on" for
example.  But this was probably before you got into it.  :-)

I don't do much with any flavor of windows,  since 3.1 onwards,  and don't
care to try and deal with programming on that platform at all.

Linux,  however,  is another story...

 PS> Learning C syntax was easy, the hard part (as always) is getting to
 PS> know the standard library functions.

Well,  there's standard library functions and then there's standard library
functions.  Stuff that I'm familiar with is probably pretty near universal.
 It's the platform-specific "standard" stuff I need to get to
know.  :-)

 PS> A good book on C programming that discusses library features and
 PS> functions that are part of the C standard would be a good start, I
 PS> guess. There are some around that focus on the Unix environment in
 PS> particular, I think. If I needed one, I would probaby visit
 PS> amazon.de (or .com in your case) and look for something.

I have some c books I got ages ago,  and now that I think of it one of them
was pretty much oriented toward the unix environment -- mentioned
"a.out" a bunch of times.    I'll have to see if I can
dig that out of wherever it's hiding.  Yeah,  I know,  a.out is pretty much
obsolete these days,  or at least on anything I'm going to be concerned
with,  but the basic stuff oughta still apply.

 PS> On Linux, if you have the man-pages package installed, (almost) all
 PS> of the common library functions and syscalls have manpages of their
 PS> own, so you don't need to remember function parameters by heart.

This is a good thing!  The problem with that is that if I'm looking for
something and don't remember exactly what it's called.  I suppose that
would be a handy way to deal with trying to understand someone else's code,
 though.

 PS> Most of the time, you also find information on which standards this
 PS> function is part of (so you can avoid non-portable code).
 PS> Sometimes, you even get example code in the manpage. 

 PS> For example, the dlopen() and dlsym() functions I mentioned in the
 PS> previous post are documented in

 PS>     man 3 dlopen

Is it necessary in general to specify the number in there?

 PS> There is an example at the end of the manpage that illustrates how
 PS> to load a library (which could also be a module of your program, it
 PS> doesn't have to be a system library), find a symbol in it, and call
 PS> the corresponding library function by pointer.

Now that sounds handy!

 PS> If you're looking for some function, there are no really good ways
 PS> of finding it. For glibc stuff,

 PS>     info libc

 PS> has introductions to everything.

I *really* disklike the user interface for info.  I'll have to try getting
at that stuff under KDE,  where they say you can do that.

 PS> Sometimes apropos can help, too: 

 PS>     apropos dynamic

 PS> would have turned up the dlopen(3) manpage among others.

I use that sometimes,  but not that often.

--- 
* Origin: TANSTAAFL BBS 717-838-8539 (1:270/615)
SEEN-BY: 633/267 270
@PATH: 270/615 150/220 3613/1275 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.