Welcome, Guest. Please login or register.

Author Topic: C/C++ learning  (Read 6538 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
C/C++ learning
« on: February 25, 2003, 11:55:07 AM »
Hi all,

There's been a lot of discussion on programming recently. It seems to be the case that there is much interest (both positive and negative) in C/C++. One thing that was clear to me is that there are quite a number of people who want to learn but are put off for different reasons.

Something Atheist wrote, suggesting you won't learn from a message board got me thinking. Does anybody think a series of posted tutorials in C/C++ would be useful for those interested?

Assuming some C/C++ coders could find the time to organise it, that is...

I got thinking, each tutorial could be a seperate thread and people could post their queries on that topic rather than a large monolithic thread. The basic rules would be that questions are answered (where possible) and no arguing over semantics and C vs BASIC etc :-), unless it clarifies a point relevent to the subject matter.

Once the language is covered, those with the relevant expertise could introduce Amiga specific coding.

I wouldn't mind contributuing to a such a project if it could be organised.

Suggestions?

Peace out,
K
int p; // A
 

Offline z5

  • Sr. Member
  • ****
  • Join Date: May 2002
  • Posts: 366
    • Show only replies by z5
    • http://ada.untergrund.net
Re: C/C++ learning
« Reply #1 on: February 25, 2003, 12:00:59 PM »
Well, i for one would be really interested (i just bought a book on C++)!!
A.miga D.emoscene A.rchive: Relive the dreams...
 

Offline Bodie

  • Hero Member
  • *****
  • Join Date: Dec 2002
  • Posts: 671
    • Show only replies by Bodie
Re: C/C++ learning
« Reply #2 on: February 25, 2003, 12:04:00 PM »
Quote

z5 wrote:
Well, i for one would be really interested (i just bought a book on C++)!!



Same!

Hasn't someone, Sidewinder i think, already started a tutorial on their webpage?
 

Offline sgm

  • Newbie
  • *
  • Join Date: Feb 2003
  • Posts: 46
    • Show only replies by sgm
Ciao,
Stefano.
 

Offline holbromf

  • Newbie
  • *
  • Join Date: Jul 2002
  • Posts: 9
    • Show only replies by holbromf
Re: C/C++ learning
« Reply #4 on: February 25, 2003, 01:21:50 PM »
Ira Pohl has usefull books on the use of C++ syntax to support Object Orientation when you have some experience in C++.

                                                       Cheers     Mike
 

Offline Themamboman

  • Lifetime Member
  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 164
    • Show only replies by Themamboman
Re: C/C++ learning
« Reply #5 on: February 25, 2003, 02:55:10 PM »
How about C++ tuts specifically aimed at Amiga programming?
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C/C++ learning
« Reply #6 on: February 25, 2003, 03:20:07 PM »
Quote

Themamboman wrote:
How about C++ tuts specifically aimed at Amiga programming?


Well, I feel that just learning C/C++ would be better for the majority of would be recipients.

Once you know a language well, understanding the SDK for a platform is often a good deal easier anyway.

If you get into C++ big time, then like me, you'll probably find that you tend to abstract away the AmigaOS dependent stuff behind your own preferred classes anyway ;-) All of which helps more than you might realise. A fully debugged Window class that encasulates your basic intuition window can save you lots of time later when you want to write another app and can't be bothered having to recode all the window/event handling stuff!
int p; // A
 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show only replies by jdiffend
Re: C/C++ learning
« Reply #7 on: February 25, 2003, 04:27:18 PM »
There are lots of web sites with C/C++ tutorials.
You can find a lot of stuff here and Amiga example source on Aminet.
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: C/C++ learning
« Reply #8 on: February 25, 2003, 06:20:38 PM »
who would be interested in starting up an amiga programming tutorial site?
a number of people could contribute, i would like to help in such an activity


oh and if anybody would like to know of a good reference for C:
C: The Complete Reference
& its by Herbert Schildt, so you know it must be bloody good
 :-)
 

Offline Sidewinder

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 241
    • Show only replies by Sidewinder
    • http://www.liquido2.com
Re: C/C++ learning
« Reply #9 on: February 25, 2003, 07:57:37 PM »
I already have started an Amiga programming tutorial site.  I'm always looking for contributions by other programmers or ideas of what should be covered in the tutorials.  It would most definately be best to have a single, comprehensive resource, than to have 100 different tutorials that repeat the same information.
Sidewinder
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C/C++ learning
« Reply #10 on: February 26, 2003, 09:52:39 AM »
Hi Sidewinder,

That's an interesting site you got there. Nicely laid out and easy to nagivate.
I do have one or two comments if I may be so bold. Also this isn't intended to be a criticism, just observation...



I hope you don't think I'm being to picky, but according to the ANSI 2.0 C rules, either you do not define the signature of main(), or if you do define a return type/arg list, you should also specify a return value, else it goes undefined:

either (old style)

#include
main() /* no signature */
{
   printf("Hello World\n");
}

or (preffered as of 1999 amendment)

#include
int main() /* returns int, no args passed*/
{
   printf("Hello world\n");
   return 0;
}

Using 'void' to signify no arguments is depricated (behaviuor adopted from C++).



Back to tutorials, I do feel that there is a bit of a leap for beginners moving from 'hello world' to opening an intuition window in the second lesson. I realise that it was a demonstration only, but could look quite daunting to those new to the language.

Well, enough said - youre probably ready to climb through the monitor and kick my ass by now ;-)

Going back to my original post, what I had in mind was something that would introduce the language itself, structured something like this

1) What is C?
     Origin, about compiler v interpreter etc.
     Source code arrangement, #includes etc'

2) Hello world
    The canonical 1st program.

3) Variables & Types
    Variables, types, arrays, enums, constants etc.
    Scope, duration.

4) Operators
     Overview of C operator syntax, precedence rules etc.

5) Programming constructs
    if/else
    switch/case/default
    loops
    goto (and misuse of)

6) Functions
    Procedural programming paragdim.
    Argument passing.
    return types etc.

7) IO
    More detailed look at basic ANSI C IO.
    Formatted IO.
    File streams.
    Binary IO.

8) Pointers
    The dreaded lurgy explained ;-)

9) Structures
    Cocept, uses, arrays of structures etc.

10) Additional topics
    Advanced pointers, function pointers, lists etc, vararg functions, unions etc.

That would basically cover C as a language.

I would begin on C++ only once sufficient C was understood to make sense of what was going on syntax wise. Probably introduce the concept of classes once C structures had been covered and move on from there.

As for AmigaOS specific coding, I would aim to start on that once C functions had been covered and not before.

Disclaimer : All of the above is IMHO ;-)
int p; // A
 

Offline FuZion

  • Full Member
  • ***
  • Join Date: Jul 2002
  • Posts: 223
    • Show only replies by FuZion
    • http://www.deceptiveaudio.co.uk
Re: C/C++ learning
« Reply #11 on: February 26, 2003, 10:04:19 AM »
I would certainly be interested in using a site like this.
Karlos seems to have a bit of know how too, for a beginner like  ;-)
I like the idea of individual forums on each tutorial too helping to focus on each one individually.

Is there anything anyone can do to make this happen?
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: C/C++ learning
« Reply #12 on: February 26, 2003, 11:07:12 AM »
Hi again,

Quote

FuZion wrote:
Karlos seems to have a bit of know how too, for a beginner like  ;-)


Why, ya' cheeky beggar like, erm, I think... :-P

I'm not new to C/C++, though not as knowledgable as I'd like to be, especially when it comes to AmigaOS specific coding and the V3 C++ STL.

Even so, knowing something is one thing, teaching it however, is another matter :-)

I did do a stint as an undergraduate supervisor during the first (and only) year of my ill-fated chemistry PhD. That involved quite a lot of designing tutorials, interactive tuition and the like.

Quote

I like the idea of individual forums on each tutorial too helping to focus on each one individually.


Yeah, I thought that would be quite handy since it gives a degree of interactivity which is often essential for learning. You'd need a few ground rules about off topic posts and stuff, as I mentioned at the start.

Quote

Is there anything anyone can do to make this happen?


I was thinking that it needs a few people to work on it. Maybe Wayne could open up a teaching zone in the forums? That could pave the way for all sorts of handy stuff, everything from AmigaDOS scripting to web design.

Even without that, it wouldn't be too bad just to write a tutorial and post it normally in this forum. I do admit, I've yet to find a way to preserve certian essential formatting such as indentation - it always ends up with the whitespace stripped out after I post!
int p; // A
 

Offline Atheist

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 820
    • Show only replies by Atheist
Re: C/C++ learning
« Reply #13 on: March 02, 2003, 10:08:33 AM »
Hi Karlos,

Just noticed this thread. This a great idea if someone is willing to set it up.

Like you said, it would have an additional set of rules to the ones already being used, concerning OT talking, etc.etc.

For me to participate, even more rules are needed.

Yes, more.

A) 68k and A1 should be separate, people can always look across the fence.
B) We all use the same Version no. and brand of C or C++ (orANSI) compiler, debugger, linker, etc. (I'm a beginner, so don't have a preference).
C) Everyone has to have the same SDK.

A very specific list of every item needed to participate, easy to find the list, and a http:// where to buy the items.

Maybe, by chance, you read about my ridiculous difficulties in making a RAM disk work on my w98se?

We all have to be on the same wavelength. I'm not stupid, but, when I'm learning something, even a trivial thing like everybody in the classroom having different keyboards is enough to make me give up. When you say, pick this menu item, I expect it to be exactly where you tell me to look. Type this in, I will type it letter for letter.


I'm not a quitter, but I need solid reference points.

Amiga! Lets change the world!
\\"Which would you buy? The Crappy A1200, 15 years out of date... or the Mobile Phone that I have?\\" -- bloodline
So I guess that A500, 600, 1000, 2000, CDTV, CD32, are pure garbage then? Thanks for posting here.
 

Offline Mikey_C

  • Sr. Member
  • ****
  • Join Date: Feb 2002
  • Posts: 322
    • Show only replies by Mikey_C
Re: C/C++ learning
« Reply #14 on: March 02, 2003, 10:19:07 AM »
I for one, would be interested in such a project here on Amiga.org. Perhaps a seperate Tutorial Forum could be set up?

Also, what compiler should we all be using?
(so that I can purchase one in advance, if the idea goes ahead. - I hope it does.)

Mikey C
YNWA!