Page 1 of 1

Source Code for "An Introduction to C & GUI Programming"

Posted: Wed Apr 17, 2019 1:42 am
by AndrewDavison
I've been reading Simon Long's new book, "An Intro to C and GUI Programming" (https://www.raspberrypi.org/magpi/issue ... ogramming/), and would like to download some of the code examples. Is the source online somewhere?

- Andrew

Re: Source Code for "An Introduction to C & GUI Programming"

Posted: Wed Apr 17, 2019 11:29 am
by Andyroo
Why not just copy and paste from the PDF?it may take a few mins where the code crosses pages buts that’s not too much of an issue.

e.g. from page 11

Code: Select all

  #include <stdio.h>
  void main (void)
  {
    /* A print statement */
    printf ("Hello world!\n");
  }
The PDF can be found at https://www.raspberrypi.org/magpi-issue ... IGITAL.pdf

I think it’s great the Foundation both sell books and make the PDFs available - I can read on the loo and copy and paste :lol: :roll:

Re: Source Code for "An Introduction to C & GUI Programming"

Posted: Wed Apr 17, 2019 2:46 pm
by DougieLawson
Andyroo wrote:
Wed Apr 17, 2019 11:29 am
Why not just copy and paste from the PDF?it may take a few mins where the code crosses pages buts that’s not too much of an issue.
That's unreliable and likely to introduce nasty hard to find bugs.

Having the code on github.com is a much better suggestion.

Re: Source Code for "An Introduction to C & GUI Programming"

Posted: Wed Apr 17, 2019 3:46 pm
by gkaiseril
The PDF format also allows the attachment of files to a PDF, so it is possible to add the a text file of the code to the PDF. It is best to save the files in a format other then a zip compressed file since the PDF format includes zip compression methods for the internal storage of objects withing the PDF. This may also increase the size of the PDF. Another option would be in include the code within an annotation/comment text box.