405e Some new C programming examples - files, structs, unions etc
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Some new C programming examples - files, structs, unions etc

A series of new "C" examples have been added to the web site - a course for a small group allowed me to go somewhat away from the more normal run yesterday and write some new illustrations in front of them.

Call by value v call by pointer comparison: link

Using extern to share a variable between two different sources: link and link

Handling command line parameters through pointers: link

Structures, and pointers to structures: link and link

Unions, where memory is shared between variables: link

File handling through open and read, fopen and fgets compared: link and link

And some C++ examples:

Fomatting floating point numbers in C++: link

Using a vector (in effect an object that's an array but can be extended as required: link

All examples have comments and sample outputs included and will open in a new window if you click on the links. All simple examples, and they're often the best!
(written 2007-12-19)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
C204 - C and C based languages - Functions, Macros and programs in multiple files
  [3721] Naming blocks of code, structures and Object Orientation - efficient coding in manageable chunks - (2012-05-06)
  [3717] Returning extra results from a function in C - (2012-05-03)
  [3237] Using functions to keep look and feel apart from calculations - simple C example - (2011-04-09)
  [2841] C Course exercise and sample answer - source in 2 files - (2010-06-30)
  [2575] Sharing variables between files of code in C - extern - (2010-01-14)
  [2570] Function Prototypes in C - (2010-01-11)
  [1163] A better alternative to cutting and pasting code - (2007-04-26)
  [775] Do not duplicate your code - (2006-06-23)

C207 - C and C based languages - Pointers and references
  [3399] From fish, loaves and apples to money, plastic cards and BACS (Perl references explained) - (2011-08-20)
  [3386] Adding the pieces together to make a complete language - C - (2011-08-11)
  [3242] How to return 2 values from a function (C++ and C) - more uses of pointers - (2011-04-10)
  [3238] Bradshaw, Ben and Bill. And some C and C++ pointers and references too. - (2011-04-09)
  [3121] New year, new C Course - (2011-01-05)
  [3004] Increment operators for counting - Perl, PHP, C and others - (2010-10-18)
  [2670] Pointers to Pointers to Pointers - what is the point? - (2010-03-10)
  [2572] The what and why of C pointers - (2010-01-13)
  [2005] Variables and pointers and references - C and C++ - (2009-01-23)
  [1497] Training Season Starts again! - (2008-01-07)
  [1155] Pointers in C - (2007-04-19)

C209 - C and C based languages - Structures and Unions
  [3145] Structures v Structure Pointers in C. How, which, why. - (2011-01-25)
  [3122] When is a program complete? - (2011-01-06)
  [2573] C Structs - what, how and why - (2010-01-13)
  [1669] What are Unions (C programming) - (2008-06-08)
  [1584] Using Structs and Unions together effectively in C - (2008-03-21)
  [1572] C - structs and unions, C++ classes and polymorphism - (2008-03-13)

C235 - C and C based languages - I/O in C++
  [3810] Reading files, and using factories to create vectors of objects from the data in C++ - (2012-07-21)
  [3807] Reading (and writing) files in C++ - (2012-07-18)
  [3390] Printing objects in C++ - (2011-08-13)
  [3252] C++ - unknown array size, unknown object type. Help! - (2011-04-17)
  [3124] C++ - putting the language elements together into a program - (2011-01-08)
  [1675] Comparing Objects in C++ - (2008-06-13)

C238 - C and C based languages - Templates
  [3982] Using a vector within an object - C++ - (2013-01-19)
  [3509] Operator Overloading, Exceptions, Pointers, References and Templates in C++ - new examples from our courses - (2011-11-06)
  [3388] Templates in C++ - defining a family pattern of methods / functions - (2011-08-12)
  [3245] Collections in C and C++ - arrays, vectors and heap memory blocks - (2011-04-12)


561e
Back to
Decisions - small ones, or big ones?
Previous and next
or
Horse's mouth home
Forward to
FSB leaves its members feeling like mushrooms
Some other Articles
A story about benchmarking PHP
The Christmas Letter
Next course - 7th January 2008, Regular Expressions
FSB leaves its members feeling like mushrooms
Some new C programming examples - files, structs, unions etc
Decisions - small ones, or big ones?
Shopping for Christmas and looking forward
Tcl/Tk - updating your display while tasks are running
Using Tcl/Tk resource files for flexible applications
Making a variable dynamically visible in a Tcl/Tk GUI
4106 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

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

PAGE: http://www.wellho.net/mouth/1478_Som ... s-etc.html • PAGE BUILT: Mon May 27 06:13:46 2013 • BUILD SYSTEM: wizard
0