Training, Open Source Programming Languages

This is page http://www.wellho.net/resources/C239.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
C and C based languages module C239
Putting it all together
Exercises, examples and other material relating to training module C239. This topic is presented on public courses Learning to program in C and C++, C++ for C Programmers, C and C++ Programming, Learning to program in C and C++, C and C++ Programming

Background
In this section we'll show you several complete but small applications in C and C++ that put together all the various facilities we've covered so that you can see how they all interact in real life. One of the big uses that's made of C and C++ in some organisations these days is in adding specialist facilities to PHP, Perl, Tcl and Python and this module also provides a brief introduction to how this is achieved.
Related technical and longer articles
What makes a good variable name?

Articles and tips on this subjectupdated
4559When do I use the this keyword in C++?
Question: When do I use the this keyword in C++? Answer: When I expliciy need (or want) to refer to a member variable or object within the current object. Example:    class Transport{       public:          Transport(int);          int ...
2015-10-29
 
4374Test driven development, and class design, from first principles (using C++)
I'm teaching OO / class design from first principles today ... in stages. The chosen source language is C++, but the principles are well applied across other OO languages too. Stage 1 - write your test program to make sure it works for your customers want to do. Remember that the "customer is king" ...
2014-12-30
 
4326Learning to program - comments, documentation and test code
Updates material from our courses for newcomers to programming ... we're very happy to help newcomers learn about the basic principles of programming, running an extra day for a very small group on the front of our regular courses for delegates who have programmed before, but in different languages. In ...
2014-11-22
 
3810Reading files, and using factories to create vectors of objects from the data in C++
On our C++ courses, we concentrate on objects and object design. But we also take a wider look at topics such as references and templates that go to making the complete language, with sections covering changes to things like file handling from the underlying C language. I've just added a new example ...
2012-08-11
 
3252C++ - unknown array size, unknown object type. Help!
There are time when you're writing a program where you say "I don't know". • I don't know how many records / object I'm going to read from a data file into an array - so I can't set the size of my array • I don't know what sort of object I'll be creating from a line I've read from a data ...
2011-04-17
 
3069Strings, Garbage Collection and Variable Scope in C++
In C, you'll handle strings as arrays of chars (type char *) and that does work - but with grumbles from the compiler about deprecation - in C++. The more modern (or shall we say "more OO") approach is to handle strings as objects - and those will be objects of type string, with headers loaded via   #include ...
2010-12-04
 
3067Using C and C++ functions in the same program - how to do it
If you have some native C functions that you want to include in your C++, can you do so? The answer is a - slightly reserved - yes. Firstly, you need to have your main program in C++ rather than being one of the C elements. Then you need both the C and C++ compilers to be from the same family / ...
2010-11-24
 
2851Further C++ material - view new or old
I've taken out the old header <iostream.h> and replaced it by the current <iostream>. I've adding in using namespace std; where I've need to, in order to allow me access to cin and cout without a need to prefix then with std:: under the new header file (and to save me loads of errors at load ...
2010-07-04
 
2674Make and makefiles - a commented example to help you learn
If you're making an executable C++ file you build it from a whole lot of .o files, each of which you have compiled from a .cpp file. And you also build in library files. If you change a .cpp file, then you have to recompile it into a .o ... but don't forget that you also have to recompile the .cpp ...
2010-03-13
(longer)
2673Multiple Inheritance in C++ - a complete example
C++ and some other OO languages support multiple inheritance ... Java and some others do not, and it's often argued that multiple inheritance is an unnecessary complication. That may be the case in some languages, but certainly in Perl 5 it is necessary to have it to make use of eome of the modules ...
2010-03-12
 
2646Compile but do not run PHP - syntax check only
The -l option to PHP on the command line compiles but does not run the code in the file - so it's very useful for syntax checking your code. Here's an example where I tested a file with a deliberate mistake: -bash-3.2$ php -l wsse.php Parse error: syntax error, unexpected '{', expecting '(' in wsse.php ...
2010-03-03
 
925C++ - just beyond the basics. More you can do
Things you can do in C++ ... just a bit beyond the first basics of a class: 1. You can declare that a method is const if it doesn't change any of the instance variables and that will make it a bit more efficient when you run it. 2. You can refer to an instance variable within a method using this-> ...
2009-01-01
 
1181Good Programming practise - where to initialise variables
It's a good idea to initialise your variables directly before you use them for the first time if you're going to use them as accumulators. By accumulator I mean that you're going to write assignments such as:   $n += 4; # Perl   incr notepad; # Tcl   lappend flcodes [lindex ...
2007-05-11
 
945Code quality counts
We're celebrating Geekmas this weekend ... and we've got a full place. Plus others who are coming in for the day. Really good session yesterday on the good DESIGN of an interactive (scripted) web site that "mines" user information to give a tailored presentation, and a great intro by Paddy to Python's ...
2006-11-26
 
836Build on what you already have with OO
If I start recalling a "Goons" sketch, then I'll show my age .... but never mind. It was a RERUN that I saw ;-) Spike Milligan is counting votes at an election. "Two thousand, six hundred and forty two". "Two thousand, six hundred and forty three". "Two thousand, six hundred and forty four" ... "Would ...
2006-08-18
 
Examples from our training material
Expense.cpp   A second subclass for multiple inheritance demo
Expense.h   Header file for second subclass
Film.cpp   main subclass for multiple inheritance demo
Film.h   header file for main subclass - multiple inheritance demo
Filmtest.cpp   Main program for multiple inheitance demo
HireFilm.cpp   Main class for multiple inheritance demo
HireFilm.h   Main class specification - multiple inheritance demo
Make_mark_2   Alternative Makefile to show Makefile facilities
Makefile   Makefile for multiple inheritance demo
Ninety.cpp   vector, factory method, files, tokeniser
alltogether.cpp   7 file example
complete.cpp   this, vector, factory, inherrited constructor, file input, tokeniser
flow.cpp   Reading a file named on the command line within a factory
fourthobject.cpp   7 file full example with a factory and a vector
pd1.cpp   Inheritance in C++ - base demonstration
pd2.cpp   add an array of objects
pd3.cpp   Add an object comparator
pd4.cpp   add iostream / namespace, inline, new, printing function, override +
pd5.cpp   Switching from array to vector
service_11.cpp   classes and subclasses
trains.txt   Data file for flow / flow2 / flow4 examples
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Practical examples of C and C++ programs.
Planning your application through UML and patterns.
Integration with PHP, Perl, Python and Tcl.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Ruby, Lua, Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre.


© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/C239.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb