Nest

Search
Skip to content
  • Join us
  • Contact
  • Announcements
  • Resources
    • Report formatting guidelines
    • Software setup for programming
      • Remote access using RDP
      • Running Linux on your own
      • Geany and compiler installation guide
      • Configuring and using Geany
    • Remotely accessing P drive (SFTP guide)
    • SSH connection guide
    • Introduction to algorithms and UML
      • UML example: WD40
      • UML example: filtering positive numbers into an array
    • File browser
    • Links
  • Coding guides
    • Coding style
    • Declaring and initializing variables
    • Using printf with tips and tricks
    • Conditional statements
    • Loops
    • Fun with Valgrind
    • Stream redirection
    • Using a debugger with Geany
  • Programming I
    • Getting started: Programming 1
    • Study guide
    • Labs
    • Weekly homework
    • Homework I
    • Algorithm tasks
    • Code examples
      • hello.c (2025)
      • Loops – multiplication table
      • math.h library
      • Distance converter (arrays with functions)
      • Accessing command line arguments
      • File name as command line argument
      • Managing multiple files
      • Manipulating characters (characters.c)
    • FAQ
  • Programming II
    • Getting started: Programming 2
    • Labs
    • Code examples
      • Identifying a flying object (enumeration example)
      • Structure array example
      • Reading from a file into structure array
      • Structure pointer example
      • Returning a struct
      • Data type agnostic bubble sort
      • Substruct example
      • Creating easily reusable code
      • Writing to multiple output streams
      • Structure pointer as a member of structure
      • realloc() partial solution
      • struct_wrapper_dynamic

Code examples

The following code samples are related to Programming II labs. Most samples have both code and explanations and are tied to certain labs. They may also be solutions for lab tasks with additional explanations.

  • Identifying a flying object (enumeration example)
  • Structure array example
  • Reading from a file into structure array
  • Structure pointer example
  • Returning a struct
  • Data type agnostic bubble sort
  • Substruct example
  • Creating easily reusable code
  • Writing to multiple output streams
  • Structure pointer as a member of structure
  • realloc() partial solution
  • struct_wrapper_dynamic
  • Announcements
  • Contact
  • Coding style
  • Software setup
  • Programming I
    • Labs
    • Code examples
  • Programming II
    • Labs
    • Code examples
  • Links
  • Report issues (Uni-ID required)
  • Eesti
  • English

Pesa 2024 Powered by magic and unicorns