AndrewDavison
Posts: 1
Joined: Mon Apr 15, 2019 3:20 pm

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

Wed Apr 17, 2019 1:42 am

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

Andyroo
Posts: 3290
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

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

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.

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:
Need Pi spray - these things are breeding in my house...

User avatar
DougieLawson
Posts: 35350
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

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

Wed Apr 17, 2019 2:46 pm

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.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

gkaiseril
Posts: 609
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

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

Wed Apr 17, 2019 3:46 pm

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.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

Return to “The MagPi”