English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 02 September 2014, 17:53   #1
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
C: Tutorials in .txt format requested

Hi.

I'm currently trying to learn C again. I'm using NetBSD and I don't have a pdf app installed, as most of the torrent books or tutorials are available in .pdf format.

Does any one have a tutorial in .txt format so I can run it on my NetBSD partition (I'm using twm as the window mananger).

I've got the ones from LSD Docs, Aminet, and a couple for textfiles.com if any others are floating out there would be appreciated.

TIA.
redblade is offline  
Old 02 September 2014, 20:58   #2
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
Hi
http://www.synchrondata.com/pheaven2/www/area4.htm

I suppose that you can browse that one using Lynx.
http://jakeworld.org/JakeWorld/index...e-c-tutorials/
Kamelito
kamelito is offline  
Old 02 September 2014, 22:09   #3
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
In my opinion, ignore "C tutorials" in .txt files found on old Amiga disks. They are most likely whipped together by Joe Schmoe back in the day, and that kind of material can never be a good or reliable source for learning. Stay away from it.

Have a look at http://www.iso-9899.info/wiki/Books for starters. A good book to start with is "The C Programming Language" written by Dennis Ritchie himself. It's been floating around on the Internet since forever, and it is in PDF format, but there has to be freely available PDF readers for BSD so don't let that stop you.
Leffmann is offline  
Old 03 September 2014, 10:25   #4
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
Why not simply install evince?
Hewitson is offline  
Old 03 September 2014, 12:28   #5
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by redblade View Post
I'm using NetBSD and I don't have a pdf app installed
I'm also using NetBSD as my main OS. Hewitson is right: evince is a nice PDF reader and it doesn't depend on a full Gnome or Enlightenment environment. I'm using it with Openbox as window manager.
Alternatively install xpdf from pkgsrc.
phx is offline  
Old 03 September 2014, 13:58   #6
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
The K&R book is still the definitive source on the original C language.
http://en.wikipedia.org/wiki/K%26R
http://en.wikipedia.org/wiki/The_C_Programming_Language
However do keep in mind, that it can only give you some directions and the idea behind the language nowadays, as the language itself has drastically evolved especially during the past few years with the acceptance of C++11 - and C++14 on the horizon.
None of the books for the recent languages would give a good background for C itself though, so I'd say start with that, but don't try to learn it - code in it won't even compile these days unless your compiler is in legacy mode...
IFW is offline  
Old 03 September 2014, 15:10   #7
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Hi guys.

My wireless card is not supported with NetBSD but is detected with the quick splash linux that is on my Asus netbook. That's why I don't have any .pdf viewers or any other packages installed. I also don't have a ethernet cable.

Also alot of those packages seem to need other packages to run, i.e you download you a amiga util, then you need explode.library, req.library, arp.library.

But I will look into them . Thanks.

I couldn't even get the x11 source to some of the basic default X Apps to compile . Still persistence is the key.

@kamelito: Excellent, Lynx doesn't require any external packages I've also visited that first site you mentioned, I forgot there was a C section, I'm pretty sure there was a Amiga or a 68k assembler section at one stage.

@phx: Is it possible to use Amiga bitmap fonts under X11? or as the console font?

@IFW: I remember doing a 'Learn C in 3 days' tutorial book, The NetBSD compiler kept bringing up security errors, warning me to use other functions instead.
redblade is offline  
Old 03 September 2014, 21:04   #8
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
Unfortunately K&R is a bit out of date regarding new ISO standards, namely C99 and C11 now. They should update it like what did Rago for Stevens book, "Advanced Programming in the UNIX Environment". Kamelito
kamelito is offline  
Old 03 September 2014, 21:22   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by redblade View Post
My wireless card is not supported with NetBSD
Which chip is on that card? Or do you know the PCI vendor/product? Maybe it is supported in the current source.

You should really get your network up and running. Even the name NETbsd suggests that you should have a network.

Quote:
@phx: Is it possible to use Amiga bitmap fonts under X11? or as the console font?
Theoretically yes. For the NetBSD/amiga console or wscons?

The format of the Amiga 8x8 console font in the kernel is just an array of 8 bytes for each character, starting with ASCII code 32. Here is the source for a dumpfont tool, which creates a NetBSD source out of an Amiga font:
ftp://ftp.netbsd.org/pub/NetBSD/NetB...tand/dumpfont/
You have to replace src/sys/arch/amiga/dev/kf_iso8859_1_8x8.c and compile a new kernel.

For wscons you would use wsconscfg(8).

There may also be Amiga font to BDF converter for X11. But I don't know any.

Quote:
@IFW: I remember doing a 'Learn C in 3 days' tutorial book, The NetBSD compiler kept bringing up security errors, warning me to use other functions instead.
Then this book is probably no longer up to date.
phx is offline  
Old 05 September 2014, 14:44   #10
TheDarkCoder
Registered User
 
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
To study C language I would recommend K&R only to people who already know how to program in a different language and have a certain programming experience.

For beginners, that have already a little programming knowledge I recommend
this book

The book does a good balance of 2 different (and sometimes colliding) didactic goal:
1) introduction to programming
2) explain the C language technicalities (which are definitely not trivial)

For absolute beginners, I suggest to start learning programming with a different language.

my 2 cents
TheDarkCoder is offline  
Old 05 September 2014, 23:54   #11
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
Actually, the original C language is really easy to learn if you know any kind of assembly... so K&R is a very good choice then.
If you don't, then the concept of pointers etc. can get fairly weird and as Dark Coder says you might be better off learning something more trivial first.
You can however get away without using "classic" C features if you stick with the high level and abstract stuff in C++11 or later - in fact they try to make you forget there that these things ever existed in the languages
IFW is offline  
Old 06 September 2014, 15:22   #12
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
There's no point learning C99 etc. The best Amiga C compilers target ANSI C (aka C89) so that is what should be learnt. Plus the new features in C99 and onwards are mostly useless and in some cases can break backwards compatibility.
Minuous is online now  
Old 08 September 2014, 00:37   #13
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
You are certainly joking?

I don't see how new features like snprintf, stdint.h, variable-length arrays, long long (64-bit), etc. can be useless? They improve security (e.g. snprintf) and portability (e.g. stdint.h types) of your code.

How can any code that you write today in C99 break backwards compatibility?
phx is offline  
Old 08 September 2014, 05:41   #14
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
OK, "mostly useless" is an exaggeration, but I've never missed any of it except long long. But anyway, if the C compiler doesn't support it then it can't be used, so I avoid using those extensions. Perhaps I should write some header files to enable SAS/C to support snprintf(), stdint.h, etc. or has someone already done this?

>How can any code that you write today in C99 break backwards compatibility?

The auto keyword was redefined in a non-compatible way for C++ 11. However, researching further, that seems to only apply to C++, not C. (The two seem to be diverging in different directions, which is odd because one of the main advantages of C++ was supposed to be that it was a superset of C, which is becoming less true.)
Minuous is online now  
Old 08 September 2014, 05:48   #15
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
Wouldn't a modern compiler such as GCC be far more efficient than SAS/C?
Hewitson is offline  
Old 09 September 2014, 00:09   #16
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
I do have GCC (StormC 4), however it is slower and produces more bloated executables, compared to SAS/C.
Minuous is online now  
Old 11 September 2014, 22:21   #17
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by phx View Post
I don't see how new features like snprintf, stdint.h, variable-length arrays, long long (64-bit), etc. can be useless?

Why is it called long long and not double long? (or quad word?)
Lonewolf10 is offline  
Old 12 September 2014, 09:52   #18
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
To avoid confusion.
Hewitson is offline  
Old 12 September 2014, 12:45   #19
drdmgee
 
Posts: n/a
Going back to PDF readers for *nix systems, muPDF is lightweight (can run successfully on a Raspberry Pi, for instance) and has fewer prerequisites than most PDF readers.
 
Old 13 February 2015, 00:06   #20
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
The C Programming book I brought in New Zealand years ago was called

The C Programming Guide 2nd edition and it was printed in 1985.

It also used the function getch() which was not in stdio.h maybe that function was around in the early 80s.
redblade is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
winuaebootlog.txt missing? Kitty support.WinUAE 2 04 May 2012 12:25
REQ: Amiga Format - BlitzBasic Tutorials AlfaRomeo AMR suggestions and feedback 23 20 February 2012 18:25
REQ: Amiga Format code tutorials AlfaRomeo AMR suggestions and feedback 6 24 January 2008 10:05
Amiga Format Tutorials Louk Coders. General 1 28 March 2007 19:29
problem with txt routine. redblade Coders. General 6 02 June 2006 08:51

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10158 seconds with 15 queries