Pedagogy of Teaching Pointers in the C Programming Language using Graph Transformations
Adwoa Donyina, Reiko Heckel · 2025
Read Pedagogy of Teaching Pointers in the C Programming Language using Graph Transformations by Adwoa Donyina, Reiko Heckel (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-20469.txt.
Introduction
Adwoa Donyina and Reiko Heckel teach C pointers with pictures, using graph transformations to act out what pointers do. Pointers are the wall most beginners hit in a first C course, because their effects are invisible in text. Visual learners, who think in diagrams, get the least help from code alone.
Their 2025 paper models pointer structures as graphs and uses the Groove transformation tool to simulate each operation step by step. Students watch links form, swing, and break as the program runs. A study evaluates whether the approach lifts understanding against standard teaching, and the paper compares it with other visual methods in the field. The bet is that seeing the heap move beats imagining it.
Catalog record
| CREATOR | Adwoa Donyina, Reiko Heckel |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 29 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-20469
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Pedagogy of Teaching Pointers in the C Programming Language using Graph Transformations Adwoa Donyina, Reiko Heckel Abstract Visual learners think in pictures rather than words and learn best when they utilize representations based on graphs, tables, charts, maps, colors and diagrams. We propose a new pedagogy for teaching pointers in the C programming language using graph transformation systems to visually simulate pointer manipulation. In an Introduction to C course, the topic of pointers is often the most difficult one for students to understand; therefore, we experiment with graph-based representations of dynamic pointer structures to reinforce the learning. Groove, a graph transformation tool, is used to illustrate the behaviour of pointers through modelling and simulation. A study is presented to evaluate the effectiveness of the approach. This paper will also provide a comparison to other teaching methods in this area. 1 Introduction Every student has a distinct learning style, which should be enabled by their learning environment to allow them to succeed. In [ 15 ] the authors evaluate different learning styles in a move towards more student-centered classes. There are visual and non-visual learners; however visual learners tend to gain higher comprehension [ 13 ] . Within the realm of visual teaching techniques there are different depths, from using visual aids such as PowerPoint slides via static more or less formal representations such as pictures, maps, diagrams and charts, to dynamic and interactive visualisations. We are proposing a visual learning pedagogy using graph transformations for the modelling and simulation of pointer manipulations in C. This is often the most difficult topic for students to understand in an introductory C programming course. We report on an experiment in utilising a graph-based representation of dynamic pointer structures during a revision session at the end of the course and compare the test results of this class to those of an otherwise equivalent class a year earlier. This paper is organized as follows. In Section 2 we discuss background on the traditional methods of teaching C pointers at university and briefly introduce concepts needed to understand our proposed pedagogy. In Section 3 we present our approach of representing pointer manipulations using graph transformation. In Section 4 we illustrate it by a simulation based on an example. In Section 5 we present results from an experiment using the approach during the revision stage of a programming course. In Section 6 we compare and contrast related work. In Section 7 we will conclude the paper and discuss future work. 2 Background In many universities, C is the first programming language on the curriculum. The Computer Science and Cyber Security programme at the University of New Haven (UNH) teaches computer languages in the order of C, C++, Python, Java. In more advanced classes students utilize these languages to study data structures and algorithms, and more specific subjects. The initial programming course teaches many fundamental skills to help students starting their programming career. Learning to program is difficult, and pointer manipulation poses particular challenges to students [ 16 ] . Therefore, there is a need to explore new pedagogical approaches to support teaching the hardest concepts in C programming. The Introduction to C Programming class at UNH is based on Chapters 1-13 of the textbook [ 6 ] . Pointers are introduced at the end of the term, to ensure that students understand the basic topics prior to being introduced to this machine-oriented way of thinking. 1. Computers and Systems 2. Programs and Programming 3. Fundamental Concepts 4. Objects, Types and Expressions 5. Using Functions and Libraries 6. More Repetition and Decision 7. Using Numeric Types 8. Trouble with Numbers 9. Program Design 10. An Introduction to Arrays 11. Character Data and Enumerations 12. An Introduction to Pointers 13. Strings For many years pointer manipulation was taught only using the textbook [ 6 ] as a resource. This uses informal illustrations of pointer structures and their changes during program execution but naturally they are restricted to a few examples and do not allow to simulate alternatives based on different input states or to show the effects of erroneous code. To improve the teaching of pointer manipulation by visual means we propose to use graph transformation [ 5 , 8 ] , in particular Groove [ 12 ] , as a pedagogical aid. Graph transformation is a rule-based approach which represents procedural knowledge in terms of a set of “IF-THEN” rules. These rules define the preconditions and effects of the basic activities. This form of modelling is in contrast to the control-oriented approach, which focuses on the ordering of events. Formally, graph transformation rules consist of left hand sides, right hand sides and negative application conditions (NACs), all of which are different graphs; however Groove combines them in one graph with colour coding [ 12 ] . The tool also supports advanced concepts such as graph constraints, negative application conditions, multi objects and patterns, and control flow specifications as well as the analysis by model checking. 3 Pointer Manipulation using Graph Transformation In addition to the traditional means of teaching pointers in the C programming language, we are proposing a new pedagogy using graph transformation systems to visually simulate pointer manipulation. The Groove [ 12 ] graph transformation tool is used to create and simulate executable pointer models. As part of a our experiment, we designed a type graph to model basic C pointer structures as shown in Figure 1 . This type graph represents how C pointers relate to addresses and objects, such as array, int or char, that may reside at those addresses. Addresses represent memory cells linked by succ edges if they are consecutive. Each pointer may refer to an address and each address may contain an object. An array is a consecutive sequence of addresses containing objects, and the Array node has a fst edge to the pointer referencing the first address of the array. The array’s length is specified using attribute len . We use the Object type’s name attribute to refer to a variable in the program code, but this is information is never used in the rules describing the operations and serves only to improve readability of the generated graphs. In particular, neither addresses nor pointers directly represent variables. Our type graph does not account for more advanced concepts such as objects of different size or the distinction between heap and stack memory, which were not covered in our introductory module. An important design decision is the explicit modelling of addresses representing memory cells and their consecutive organisation in memory (by means of succ edges). Their status as free or allocated is recorded by the Boolean attribute free to reflect the effect of C memory functions malloc() and free() . This is a lower level of representation than the obvious model of pointer structures where pointers are edges between objects; however, this implementation-oriented model also allows us to capture operations such as dereferencing * and address-of & . As importantly, we can show situations where the structure violates referential integrity, e.g., when a pointer refers to an address which is either free or holds no object, potentially leading to inconsistencies we would like to illustrate in the execution of an erroneous program.