Angelo

Leo moved quietly through the dimly lit corridors of the underground Senate, his backpack slung over one shoulder. Every step was careful, deliberate—he didn’t want to wake anyone. The air was still, the faint hum of distant machines the only sound accompanying his movements. He was almost at the exit when—

“Going somewhere?”

Leo stopped in his tracks. Jasmina stood a few steps behind him, arms crossed, watching him with an amused but knowing expression.

“I have to go try something,” he said cautiously, unsure of how much to explain.

Jasmina smirked. “Oh, we figured.”

Sebastian emerged from the shadows of a nearby corridor, his own bag slung over his shoulder. “We were just waiting for you to make up your mind,” he added with a grin, tossing Jasmina her bag.

Leo blinked, surprised. Then, a slow smile spread across his face.

They retraced their path through the tunnels, climbing the metallic ladder to the surface. Sebastian pushed against the rock covering the entrance, grunting as he shifted it just enough for them to squeeze out. The cool morning air hit them as they emerged into the forest, the first light of dawn casting long shadows through the trees.

They hurried toward the car Brielle had left behind. Sebastian slid into the driver’s seat and started the engine, while Jasmina climbed into the passenger side. Leo settled in the back as the tires crunched softly against the dirt road.

“What now?” Sebastian asked, eyes flicking to Leo in the rearview mirror.

Leo exhaled. “While I was connected to the Inquisition’s network, I sensed the machine they’re using on Elias. It’s a neural intrusion device, designed to break into his mind and extract information directly. I think I can hack into it.”

Jasmina and Sebastian exchanged a skeptical glance.

“What if you get caught?” Jasmina asked.

Leo met her gaze. “That’s the risk. But once we’re far enough from the Senate, even if they trace us, the worst that happens is they get our position. As long as we pick a spot with enough escape routes, we should be fine.”

Jasmina frowned. “And what if they try to get into your brain?”

Leo hesitated before answering. “That’s a real danger. But… I think I’m starting to understand how the Supreme AI does it. When I connected earlier, I could feel the patterns it used to force its way in. I think I can block it—at least for a few seconds.”

Jasmina and Sebastian studied him for a moment, weighing the risk. Then, as if reaching the same conclusion, they both nodded.

“Very well then,” Jasmina said.

Sebastian gripped the wheel. “Let’s do this.”

The car rolled forward, leaving the hidden sanctuary of the Senate behind. Leo, Jasmina, and Sebastian pulled the car to a stop near a quiet intersection. The road stretched in multiple directions, surrounded by clusters of buildings and transmission towers in the distance. The early morning air was crisp, the world around them still half-asleep.

Leo scanned their surroundings and nodded. “This is perfect. There are five different towers I can connect to, and we have multiple escape routes. They won’t be able to track us.”

Jasmina turned to him. “Okay, how do we do this? Do you need anything?”

Leo shook his head. “Just keep quiet for a moment. I need to focus.”

Jasmina and Sebastian exchanged a glance and immediately fell silent. Leo closed his eyes, reaching out with his mind.

In an instant, he was inside the network again. He saw the machine—the neural intrusion device clamped onto Elias’ head, its tendrils burrowing deep into his consciousness, probing, extracting. He knew he had to be quick, faster than their security systems could detect an intrusion. Instead of disabling the device outright, which would raise alarms, he altered its behavior subtly. The machine still appeared to function as intended, but instead of assaulting Elias’ mind, it merely sent him random, harmless images—fragments of nonsense, colors and sounds that would mean nothing to the interrogators watching the data feed.

Elias, if you can hear this, play along.

Leo pulled back, severing the connection before the system could recognize what had happened. He opened his eyes.

Jasmina and Sebastian were both staring at him, waiting.

“So?” Sebastian asked.

Leo exhaled. “I think it worked. I was quick. The mechanism that was weakening his brain—it’s not doing anything now. But to the Inquisitors, it looks like it’s still running. Elias will be smart enough to fake it, keep pretending he’s in pain. That’ll buy us some time.”

Jasmina narrowed her eyes. “How much time?”

“Not forever,” Leo admitted. “Eventually, they’ll realize something’s wrong. They’ll swap out the machine, upgrade the security, and lock me out completely.” He looked between his two friends. “We need a plan. And we need one fast.” Leo, Jasmina, and Sebastian set up their small campsite, pulling compact tents from their backpacks. The night air was cool, and the distant hum of the city provided a low background noise. As they worked, Sebastian nodded toward the clearing. “Here’s as good a spot as any. We can rest here for the night.”

Once their tents were set, they sat around in a circle, the dim glow of their devices lighting their faces as they strategized.

“So,” Jasmina began, “do you think they’re also trying to get inside the Rector’s brain?”

Sebastian shook his head. “I doubt it. At least, not until they’re done with Elias. The Rector is from one of the strictest Catonian orders—he’s lived in near-total isolation for most of his life. Even if they managed to break into his mind, there wouldn’t be much to find. Elias, though… that’s a different matter.”

Leo leaned forward. “We need a way to sneak in. Attacking head-on would be suicide. But if we could infiltrate the building unnoticed, maybe we’d have a shot.”

Sebastian exhaled, rubbing the back of his head. “Getting in isn’t what worries me the most. It’s getting out. Once they realize what’s happening, the entire place will be on lockdown. We’d be trapped. But honestly, before we even get to that part, we have a more immediate problem.”

Jasmina looked at him. “Which is?”

“The layout,” Sebastian said. “We need the building’s plans. Without that, we’re flying blind. We don’t know the entrances, the security systems, or where they’re keeping Elias, Jenny, or the Rector. We could try hacking into their network, but without a starting point, it’ll take too long. And Leo—if they detect you, we’re done before we even begin.”

A brief silence settled between them. Then Jasmina suddenly sat up straight.

“Let’s ask Erling!” she said.

Leo and Sebastian exchanged a glance.

Sebastian smirked. “You really think he can get his hands on the plans?”

Jasmina grinned. “If anyone can, it’s Erling.”

Sebastian nodded, already reaching for his device. “I’ll send him a message right now,” he said, typing quickly. “If anyone has a way to get into restricted systems without setting off every alarm in the city, it’s Erling.”

Jasmina smirked. “Yeah, and he’ll probably enjoy the challenge.”

Leo watched as Sebastian finished typing and sent the message. “Let’s hope he answers fast,” he said. “Because the sooner we get those plans, the sooner we figure out how to get them out.” Leo turned to Sebastian as they finished setting up camp. “We’ve got a bit of time before bed. How about you be our C master for the night?”

Sebastian raised an eyebrow. “Me? I’m no Bellardian…” He hesitated, then shrugged. “But I can try.”

Leo grinned. “I’m sure you’ll do just fine.”

Sebastian sat down, pulling out his device. “Alright, let’s see… You both covered variables, right?”

Jasmina nodded. “I kept up with Brielle last night, so I should be up to date.”

“Great,” Sebastian said. “So here’s the thing. In C, you just pretend everything is memory, and the compiler translates it into operations on registers for you.”

Leo and Jasmina nodded, following along.

“Now,” he continued, “you’ve both learned how to declare a single variable—something like int x; to tell C that you need an integer. But what if you need to store multiple numbers, not just one? What if you need an array of values?”

“Like when we used a buffer in assembly?” Jasmina asked.

“Exactly,” Sebastian said. “In C, instead of manually keeping track of memory locations, you can declare an array. If you want an array of five integers, you write it like this:

int arr[5];

Jasmina’s eyes lit up. “So int arr[5] tells C to reserve space for five integers?”

“Yep,” Sebastian confirmed.

Leo thought for a moment. “That means each number gets its own memory space, but how big is that space? Are integers always the same size?”

Sebastian shook his head. “Nope. That’s one of the tricky things about C. The size of an integer depends on the system you’re running on. In our case, the Bellardians’ terminal is a 32-bit system, which means each integer takes up four bytes.”

Jasmina frowned. “Wait… but when we were using the 8-bit emulator, each number was just one byte, right?”

“Exactly,” Sebastian said. “In your old emulator, an integer was just 8 bits, which meant you could only count up to 255. Now, on a 32-bit system, you can count up to roughly 4 billion when unsigned.”

“So does that mean memory addresses are also 32 bits? What about the values stored in memory?” Jasmina asked. “I remember that on our emulator, if we stored something at address 40, the next byte would be at address 41. Does that change here?”

Sebastian smiled. “Good thinking! But no, memory is still addressed by bytes, just like in your old emulator. That means if you store an integer at address 40, it actually occupies addresses 40, 41, 42, and 43. The size of the address itself changes though, they are 32 bits on a 32 bits system. Typically, address sizes match the size of the registers.”

Jasmina nodded slowly. “Okay… so even though the numbers are bigger, the memory still works the same way. Just more space per value.”

“Exactly,” Sebastian said. “Now, let’s talk about how to actually use arrays.”

Leo leaned forward. “Yeah, if I declare int arr[5];, how do I put values in it?”

“You use brackets,” Sebastian explained. “For example, if you want to store the number 10 in the first position, you write:

arr[0] = 10;

“And if you want to store 20 in the second position, you write:

arr[1] = 20;

Leo’s eyes widened. “Oh! So the brackets tell C which slot in the array we want to use, and it takes care of the actual memory address!”

“Exactly,” Sebastian said. “Instead of manually tracking addresses like we did in assembly, you just tell C which index you want, and it does the math for you.”

Jasmina smirked. “I like this. Way easier than manually calculating memory locations.”

Sebastian grinned. “And this works for more than just storing values—it works for retrieving them too. If you want to access the first value you stored, you just write:

int y = arr[0];

“Now y holds whatever was stored at arr[0], just like reading from memory in assembly.”

Leo nodded. “I see… so this is just a more structured way of working with memory.”

“That’s exactly it,” Sebastian said. “C is just making sure you don’t have to do the tedious stuff by hand.”

Jasmina stretched. “Alright, I think I’ve got it.”

Sebastian leaned back. “Good, because arrays are going to be really useful. We’ll be using them a lot.”
Leo furrowed his brow. “But where does all this memory actually go? I mean, when I write int x; or int arr[5];, C allocates space in memory, okay, great… but where exactly? And how does it know when that memory isn’t needed anymore?”

Sebastian grinned. “Excellent question! The variables and arrays you’ve worked with so far are all allocated on the stack.”

Jasmina’s eyes lit up. “The execution stack?”

“Exactly,” Sebastian confirmed.

Jasmina thought for a second, then asked, “So that means that every time we enter a function, all the variables and arrays are allocated, and when we leave, they just… disappear?”

“That’s exactly right,” Sebastian said. “When a function is called, C creates a new section of memory on the stack to hold all the variables and arrays needed for that function. This section is called the stack frame. It’s like a reserved chunk of memory that belongs to the function while it’s running. Then, when you write things like arr[0] = ..., you’re modifying memory inside that stack frame.”

Leo nodded slowly. “So every function gets its own little workspace in memory.”

“Yep,” Sebastian said. “And here’s the important part: when the function returns, the stack frame is destroyed. All the memory it used is automatically freed.”

He let that sink in for a moment, watching as Leo and Jasmina nodded in understanding. Then, with a small grin, he leaned forward. “Alright, now let’s put this into practice. Let’s write a function that finds the smallest value in an array.”

He pulled up a simple example.

“First, we need an array with some values. Let’s go ahead and fill it with numbers manually:”

int arr[5];
arr[0] = 23;
arr[1] = 42;
arr[2] = 12;
arr[3] = 99;
arr[4] = 25;

“Okay,” he continued, “open your terminals: http://closedsourcebook.com/terminal.html, or use the one you installed on your machine (docker run -it bellardian). Then, open your hello.c file and modify the body of the main function to create this array.”

Leo and Jasmina followed along, typing the code into their editors.

“Now,” Sebastian said, “how would you write a function that takes this array and finds the smallest number?”

They both sat in thought for a moment. Then Sebastian turned to Jasmina. “Any ideas?”

Jasmina considered for a second before saying, “I’d start by taking the first element and storing it in a variable. Then, I’d walk through the rest of the array and compare each element. If I find a smaller value, I replace the value in the variable with that new minimum.”

Sebastian beamed. “Bravo! That’s exactly the right approach.”

He leaned back. “Alright, now you try writing it on your own, without looking at the solution. At the end, use printf("%d\n", ...) to print the result. No cheating!”

Leo and Jasmina got to work, carefully constructing their code. After a few minutes, Sebastian revealed the solution:

int min = arr[0];
int i = 1;
while(i < 5) {
    if(arr[i] < min) {
        min = arr[i];
    }
    i++;
}
printf("%d\n", min);
return 0;

They both checked their work.

“Yes! That’s exactly what I wrote!” Jasmina said, proud of herself.

Leo nodded, then pointed at a line in the code. “Wait… what is i++?”

Sebastian explained, “It just means increment i by one. It’s exactly the same as i = i + 1. And conversely, i-- decrements it by one.”

Leo tested it out and grinned. “Alright, that’s pretty useful.”


Leo, Jasmina, and Sebastian woke up to the soft glow of the morning sun filtering through the dense canopy of trees. The air was crisp, carrying the scent of damp earth and pine. Birds chirped in the distance, their songs blending with the rustling leaves. It was a stark contrast to the weight of their mission ahead.

Sebastian stretched and checked his device. A grin spread across his face. “Erling is just awesome,” he said. “Here are the plans.”

The three of them huddled together, eyes locked on Sebastian’s screen as he pulled up the blueprints.

“Alright,” he began, “this place is massive. A hundred floors in total, and twenty of them are underground. The jail cells? They’re at the very bottom—levels -19 and -20. That’s where they’ll be holding Elias and Jenny.”

Jasmina let out a low whistle. “That deep? How are we supposed to get down there?”

Sebastian zoomed in on a section of the plans. “Here’s the main entrance. First problem—we have to get past the guards. After that, there are multiple elevator shafts, but look here…” He pointed at a section between them. “There’s space between the elevator structures. If we can secure a rope, we could slide all the way down.”

Leo studied the plans. “Okay, let’s say we manage that. What happens when we reach the lower levels?”

Sebastian frowned. “That’s where things get complicated. There are multiple security layers blocking access to the cells. And from the outside, I have no idea how we’re going to bypass them.”

Jasmina shook her head. “Even if we make it all the way down, we’ll be stuck.”

Sebastian tapped the screen. “Unless… unless we had access to the control panels inside. From there, we could unlock the cells.”

“Sure,” Jasmina scoffed. “From the inside. But last time I checked, we’re not inside.”

Sebastian glanced at them both, his expression shifting. “Unless one of us gets captured on purpose.”

Leo’s head snapped up. “What?”

Jasmina’s face hardened as she realized where Sebastian was going with this.

“If one of us is caught, they’ll throw us in the lower levels,” Sebastian explained. “Once inside, we’d have access to the control systems.”

Leo exhaled, staring at the plans again. “So you’re saying we let one of us get arrested and hope they don’t just… I don’t know, execute us on the spot?”

Sebastian nodded. “It’s risky. But unless you have a better idea, it might be our best shot.” Leo folded his arms, deep in thought. “What makes you so sure they’d put you in those cells? If you get arrested, fine—but why would they bring you all the way down to the bottom floors?”

Sebastian shrugged. “Think about it. If I get caught inside their own headquarters, they’re not just going to toss me in a holding room on the upper floors. High-value prisoners, potential spies, people they want to interrogate—they keep those in the most secure part of the building. That means the lower levels.”

Jasmina leaned forward, her eyes narrowing as she studied the blueprints. “That could actually work in our favor. If they’re focused on processing Sebastian, it might buy us the time we need to move undetected.”

Leo exhaled. “Alright, let’s say this plan works. We sneak in, Sebastian gets himself arrested, and we make it down to the lower floors. How do we get them out? The whole place is locked down.”

“We need a larger distraction,” Jasmina said. “Something big. We need all the guards too busy dealing with another crisis to pay attention to what’s happening in the cells.”

Leo raised an eyebrow. “Like what? What could possibly distract an entire building full of inquisitors?”

Jasmina tapped the blueprints, pointing at a specific system. “Look here. We won’t be able to access much, but we could get into the building’s communication network—speakers, emergency alarms, phones, maybe even some lighting controls.”

Leo caught on. “And… what do we do with that?”

Jasmina grinned. “We make noise.”

Sebastian nodded. “They need to believe they’re under attack. If alarms go off, if fake distress calls start coming in from different levels of the building, they’ll scramble to respond.”

Jasmina added, “And if we really want to sell it, we bring in drones. Lots of them. Swarming the building, shooting at random targets, making it look like a full-scale assault from the Companions.”

Leo glanced between them. “So we’re talking about hacking into their systems, launching an artificial attack, and hoping the confusion buys us enough time to break Elias, Jenny, and the Rector out?”

“Exactly,” Sebastian said.

Leo sighed, rubbing the back of his head. “This is insane.”

Jasmina smirked. “So… you’re in?”

Leo looked at both of them, then at the blueprints, and finally exhaled. “Yeah. I’m in.”

Leo turned to Sebastian and Jasmina. “The real question is, where are we going to find enough drones for our fake attack?”

Sebastian smirked. “I know just the guy.”

Leo raised an eyebrow. “Oh?”

“He’s someone I used to visit sometimes when I was younger, not too far from the Monastery,” Sebastian explained. “His name is Angelo. He runs a massive drone junkyard—fixes up old ones, repurposes broken parts, that kind of thing.”

Jasmina folded her arms. “And you think he’ll just hand over a bunch of drones for our little stunt?”

Sebastian hesitated. “Well… he’s a little strange.”

Leo and Jasmina exchanged glances.

Sebastian continued, “But if anyone has the parts we need, it’s him.”

Without much choice, they hopped into the car and drove toward Angelo’s place. The landscape gradually shifted, the neatly kept roads turning into rougher paths, surrounded by scattered piles of discarded metal and broken machinery.

When they arrived, they were met with a sprawling junkyard, filled with drone parts, rusting hulls, and makeshift workstations covered in wires and circuit boards. A large, weathered sign hung over the entrance: We Fix Your Drones.

Before they could take a step forward, a deep growl made them freeze. A large, intimidating dog stood at the entrance, baring its teeth.

“Great,” Leo muttered. “Friendly welcome.”

Angelo must have heard the car pull up, because a few moments later, a tall, wiry man with grease-streaked hands and wild, unkempt hair stepped out of a nearby workshop. He squinted at them, then snapped his fingers at the dog. “Quiet, Brutus.”

The dog immediately backed off, but its eyes stayed locked on them.

Sebastian stepped out of the car, stretching his arms as he looked around.

Angelo squinted at him for a moment, his expression unreadable. Then his eyes widened slightly in recognition. “Sebastian! I didn’t recognize you without the Catonian robe.” He gave him a once-over and smirked. “You finally decided to join the rest of us out in the wild?”

Sebastian chuckled. “Something like that.”

Angelo waved them forward. “Well, come on in. You look like you could use a drink.”

He led them into his workshop, a cluttered but strangely organized space filled with half-dismantled drones, spare parts, and tools hanging from every available surface. The place smelled of oil and metal, with a faint whiff of something herbal, probably tea brewing in the back.

As they stepped inside, Brutus, the massive dog that had been guarding the entrance, trotted up to Jasmina. This time, instead of growling, he nudged her hand with his nose, his tail wagging slightly.

Jasmina raised an eyebrow and smirked. “Not so intimidating after all?”

Angelo laughed. “Him? He’s a sweetheart. But he knows how to look like a bad boy when he needs to.” He gave Brutus a quick scratch behind the ears. “Good for business, you know?”

Leo glanced around, taking in the stacks of drone shells, the workbenches covered in open circuit boards, and the walls lined with mechanical arms and spare sensors.

Jasmina wandered through the workshop, her fingers trailing over scattered drone parts, wires, and metal casings. As she turned a corner, her eyes widened, and she pointed excitedly.

“Hey! I know those parts!” she exclaimed. “That’s what I used to fix Sylvia!”

Angelo, who had been watching them with mild curiosity, raised an eyebrow. “You know how to fix a service robot?”

Jasmina turned to him with a confident nod. “Yup! Used to do it all the time for my dad.”

Angelo let out a whistle, clearly impressed. “Not bad, kid.”

He gestured for them to follow and led them deeper into the junkyard. Past piles of scrap and partially assembled drones, they reached an area covered in old, rusted machine parts. Against one of the walls sat a nearly intact service robot, its limbs stiff with age, its outer shell worn but recognizable.

Angelo motioned to it. “How about that one? Think you could fix it?”

Jasmina’s eyes lit up as she inspected the robot. “Absolutely! That’s the same model as Sylvia!” She ran her hands over its frame, already assessing what would need to be repaired.

Angelo grinned, clearly pleased. “Well, perfect! It’s always good to meet someone who knows their way around machines.”

Jasmina wiped her hands on a rag and looked up at Angelo. “Do you have a toolbelt I can borrow for a second?”

Angelo nodded and gestured toward a cluttered workbench. “Help yourself.”

She grabbed what she needed and knelt beside the old service robot. Opening a panel at the back of its head, she carefully maneuvered around the tangled mess of wires inside.

“Hmmm,” she murmured, deep in concentration. “I could get this to work, but it’s going to take some time. The eye hardware is fried. If we don’t replace that, this robot won’t be seeing much of anything.”

Angelo scratched his chin. “That shouldn’t be a problem. I probably have a spare somewhere in the yard.”

He glanced toward the workshop, then back at them with a nod. “Come on, let’s take a break while I dig around for it.”

He waved for them to follow him back inside. The small kitchen space was cluttered but cozy, with mismatched chairs and an old table covered in oil-stained blueprints. He pulled out a few glasses, poured some drinks, and set them down in front of his guests before settling into his own chair with a heavy sigh.

“So,” he said, taking a sip, “what brings you here? And don’t tell me it’s for the pleasure of my company. I’ve been told I’m a grumpy old man more times than I can count.”

Sebastian smirked. “We need drones. A lot of them. They don’t have to be in prime condition—if they can fly, that’s enough. If they can shoot, even better.”

Angelo raised an eyebrow. “Drones, huh?” He leaned back, eyeing them carefully. “And you’re not asking the Companions because…?”

The three of them hesitated, exchanging quick glances.

Angelo chuckled, shaking his head. “Let me guess. This is a little personal expedition you’re planning, isn’t it?”

Angelo leaned back in his chair, drumming his fingers on the table. “You know what? The less I know, the better.” He gave them a knowing smirk before continuing. “I can get you those drones, but you’ll need to help me. I’ll show you how to find the right parts, how to get things working. But it won’t be quick. We’re talking a couple of days, at least.”

Sebastian, Jasmina, and Leo exchanged glances. A couple of days wasn’t ideal, but they knew they needed the drones.

“That’s fine,” Sebastian said. “We’ll help however we can.”

“We really appreciate it,” added Jasmina.

Angelo waved a hand. “Yeah, yeah. Just don’t break anything.”

Before they could continue, a low, rumbling growl came from beside Jasmina. She turned to see Brutus, his fur bristling, ears flattened.

“Hey!” she said, startled. “I thought we were friends!”

Before she could figure out what was wrong, a blur of fur launched from behind a pile of parts. A cat darted across the room, and Brutus immediately lunged after it, knocking over a chair in the process.

Angelo sighed, shaking his head as the chase spilled outside. “Ah, these two. Always fighting.”

As the last rays of sunlight faded over the junkyard, Angelo dusted off his hands and looked around. “Alright, that’s enough for today. Not much light left, and I don’t fancy you kids poking around sharp metal in the dark,” he said. “Come on, let’s get inside. We’ll start fresh in the morning.”

He led them toward a modest house right next to the yard, a sturdy structure patched together with various materials, much like the drones he worked on. He opened the door and stepped aside. “It’s not much, but hey, it’s home,” he said with a grin.

Leo, Jasmina, and Sebastian followed him in, setting their bags down in the entryway. The inside was cluttered but cozy, filled with old mechanical parts, tools, and a few scattered books. The air smelled faintly of oil and something cooking in the kitchen.

Sebastian leaned against the doorframe, thoughtful. “Angelo, you wouldn’t happen to know much about C, would you?”

Angelo gave him a sideways look. “Know much? Ha! I write everything in C! If it’s not written in C, it’s not worth writing,” he said with a wink. “Why do you ask?”

“These two are still learning,” Sebastian said, gesturing at Leo and Jasmina. “I’m helping, but I’m definitely not a Bellardian.”

Angelo chuckled. “Well, you’re in luck. How about a little C session after dinner? More fun than playing cards.”

Leo and Jasmina perked up at the idea.

“I’d love that,” said Leo.

“Sounds good to me,” added Jasmina.

“Alright then,” Angelo said, clapping his hands. “Settle in, make yourselves comfortable. We’ll eat, then we code.”

As they put their things away, Jasmina turned to Sebastian with a curious look. “I didn’t realize Angelo was a Companion.”

Sebastian hesitated before answering. “He used to be,” he said. “But nobody ever dared to ask him why he’s not anymore.”As they finished dinner, Angelo leaned back in his chair and then suddenly pushed all the plates aside with a grin. “Alright! Let’s code!” he announced, clearly eager to begin.

Leo, Jasmina, and Sebastian grabbed their laptops and opened them. Angelo leaned in to take a look at their screens. “Let me see your last program,” he said. He scanned the code for a moment and nodded. “Ah, I see. You’ve been introduced to arrays, but no pointers yet, huh?”

Leo and Jasmina shook their heads.

“Well,” Angelo continued, “the first thing we’re going to do is rewrite your code to use a pointer. It’s not strictly necessary in this case, but we’ll need pointers later, so better to start now.”

Jasmina looked up. “What exactly is a pointer?”

“A pointer,” Angelo said, “is an address in memory.”

“So… like in assembly?” Leo asked. “Where we would use [A] to access whatever was stored at address A?”

“Exactly!” Angelo said, pleased. “In C, we use pointers to store memory addresses instead of values. Here’s how we write one: int* ptr. The asterisk * is the important part—it tells the compiler that ptr is not holding an integer itself, but rather the address of an integer.”

Jasmina nodded, still thinking it through. “But how do we actually get the address of something? Normally, we just work with variables.”

Angelo smiled. “Good question! C gives us a special operator for that. If you want the address of a variable, you use &. Think of it as saying, ‘Where is this variable stored?’ For example, if you write int* ptr = &min, that means ptr is now holding the address of min instead of its value.”

Jasmina’s eyes widened slightly. “Wait… so &min doesn’t mean the value of min, it means the location of min in memory?”

“Exactly,” Angelo confirmed. “Every variable lives somewhere in memory. Instead of working with its value directly, you can store and pass around its address.”

Leo leaned in. “And does that work for arrays too?”

“Absolutely,” Angelo said. “Each element of an array has its own address in memory. If you write &arr[2], you get the address of the third element in the array, rather than its value.”

Jasmina processed this for a moment. “Okay… but if I have a pointer, how do I actually read from or write to the address it’s pointing at?”

“That’s where the * operator comes in,” Angelo explained. “If you want to read the value at the address a pointer is holding, you write *ptr. If you want to change the value at that address, you assign something to *ptr. So, *ptr = 42 would store 42 in the memory location that ptr is pointing to.”

Jasmina thought for a second, then asked, “So when I write *ptr, it will give me the value stored at the memory address inside ptr?”

“Exactly!” Angelo said.Angelo leaned forward, tapping a few keys on his laptop. “Now, here’s something really interesting about pointers,” he said. “Not only can they store memory addresses, but you can actually move them around. This is called pointer arithmetic.”

Leo and Jasmina listened carefully.

“Let’s say I have a pointer to an integer, declared like this: int* ptr = &arr[0];. That means ptr is currently pointing to the first element of the array. So far so good?”

They both nodded.

“Now,” Angelo continued, “what if I want to move to the second element of the array? Instead of writing &arr[1], I can actually do this: ptr + 1. In C, when you add 1 to a pointer, it moves forward in memory—not by one byte, but by the size of the type it points to. Since ptr is pointing to an integer, and integers on a 32-bit system take up four bytes, adding 1 to ptr moves it four bytes ahead, straight to the next integer in the array.”

Jasmina’s eyes widened. “So *(ptr + 1) would give me the second element, and *(ptr + 2) would give me the third?”

“Exactly,” Angelo said. “And this works for subtraction too. If you do ptr - 1, it moves backwards in memory to the previous integer.”

Jasmina tilted her head, thinking. “And it knows how much to add or subtract because it knows the size of an integer, right? So if integers are four bytes on this system, ptr + 1 actually means ‘move forward by four bytes,’ and ptr + 2 means ‘move forward by eight bytes’?”

Angelo grinned. “That’s exactly right! The beauty of this is that pointer arithmetic works across different architectures. On some systems, integers might be two bytes, or even eight bytes, but you don’t have to worry about that. The compiler figures it out for you.”

Leo nodded. “That makes sense. So instead of manually calculating memory addresses, you just let the pointer do the work.”

“Bingo,” Angelo said. “And that’s why pointers are so powerful. They give you direct control over memory, but in a way that adapts to different machines. Now, let’s try it out!”

Angelo clapped his hands together. “I want you both to modify the previous program so that instead of accessing the array directly, you use a pointer.”

Leo and Jasmina opened their laptops, ready to try.

“This time,” Angelo continued, “you’re going to create a pointer called ptr that starts at the second element of the array.”

He scribbled on a notepad:

int* ptr = &arr[1];

“Now,” he said, “inside the loop, instead of writing arr[i], you’ll dereference the pointer like this: *ptr.

Leo looked at the example Angelo had given earlier and started typing. After a few minutes, he said, “Okay, I think I’ve got it.”

Jasmina finished her own version and compared it to the example solution:

int min = arr[0];
int i = 1;
int* ptr = &arr[1];

while(i < 5) {
    if(*ptr < min) {
        min = *ptr;
    }
    i++;
    ptr++;
}

printf("%d\n", min);
return 0;

Angelo glanced at their screens and smiled. “That’s it! Now you’re really thinking like C programmers. Using pointers like this is the first step to understanding how real-world programs handle memory efficiently.”

Jasmina leaned back, satisfied. “I think I like pointers,” she admitted.


Leo, Jasmina, and Sebastian stirred awake to the sound of Angelo’s voice calling from downstairs. The morning light barely filtered through the dusty windows, and the air was crisp with the lingering chill of night.

“Come on, kids! If we’re gonna make use of the daylight, we better get moving!”

They quickly got dressed, throwing on their jackets and boots before heading down. Angelo was already waiting for them outside, hands on his hips, looking as if he had been up for hours.

“First things first,” he said, tossing them each a set of heavy gloves and protective goggles. “You’re going to need these. Some of this stuff is sharp, and you don’t want to mess with old batteries or rusted metal with bare hands. If you’re ever in doubt, call me over. Got it?”

They all nodded, fastening the gear.

“Good. Now, here’s what we’re after.” He held up a piece of drone casing, slightly dented but still recognizable. “This model is common, and there are plenty of spare parts lying around. Your job is to gather as many as you can. Doesn’t matter if they look busted—we’ll sort through them later and salvage what’s useful.”

Leo, Jasmina, and Sebastian exchanged glances, feeling a mix of excitement and determination. Then, without hesitation, they spread out into the vast junkyard, ready to dig through the heaps of discarded technology.

By the time the sun dipped toward the horizon, the junkyard was littered with drones in various states of disassembly. Leo, Jasmina, and Sebastian stood over the massive pile, sweat on their brows, their hands smudged with dirt and grease.

Jasmina wiped her forehead and let out a low whistle. “I didn’t think we’d find this many drones.”

Angelo chuckled, arms crossed as he surveyed the mountain of discarded machines. “You’d be surprised how much perfectly good tech gets thrown away. Most people don’t bother fixing things anymore.”

He clapped his hands together. “Alright, now that we’ve got the raw materials, let’s get to work. Everybody’s got a job.”

He gestured to Leo first. “You’ll start by opening up the drones. Use a screwdriver here, here, and here—” he pointed at the small screws holding the casing together— “then pass it along.”

Next, he turned to Sebastian. “You’ll inspect the internal components using this tester.” He picked up a small device with a flickering green LED. “If the light stays green, the part’s still good. If it turns red, it’s busted. Toss it in the scrap pile.”

“And me?” Jasmina asked.

“You’ll organize all the working components. Motors, circuit boards, power units—we need them sorted so we can build functional drones from the best parts.”

Jasmina nodded, rolling up her sleeves.

Angelo surveyed them with a satisfied grin. “By the time we’re done, we’ll have a new fleet, built from the best pieces we could salvage. Let’s get started.”


That night, after an exhausting day of assembling drones, Angelo leaned back in his chair, stretching his arms with a satisfied sigh.

“Alright,” he said, rubbing his hands together. “How about we do some more C programming? I have a feeling you won’t be staying here long, so we may as well make the best of the time we have.”

Leo, Jasmina, and Sebastian exchanged amused glances. They could tell Angelo genuinely enjoyed teaching them.

“Sounds good,” Leo said.

“Great,” Angelo replied, pulling his laptop closer. “So last time, we learned about pointers and pointer arithmetic. Well, it turns out you’re going to need pointers whenever you want to pass arrays to a function. Let’s think about this—so far, we’ve been writing our loops directly inside main, but what if we wanted to make a function called minimum that returns the smallest integer in an array?”

He looked at them expectantly.

Leo and Jasmina thought for a moment. Then Leo said, “Wait, how do we even pass arguments to a function? In assembly, we had to use registers.”

“Good question,” Angelo said. “Remember, in C, we’re not working with registers anymore, but the compiler still needs to pass values between functions. How do you think it does that?”

Jasmina frowned in thought. “Could it allocate space in the stack frame and write the values there?”

Angelo pointed at her. “Exactly! That’s what the C compiler does—it pushes the arguments onto the stack frame before calling the function. But what’s the problem with passing arrays this way?”

Leo hesitated, then said, “They can be really big?”

Jasmina nodded. “Yeah, copying an entire array would take up a lot of memory.”

“And time!” added Angelo. “Copying large arrays slows things down, which is why we almost never do it. So, what could we do instead?”

Leo’s eyes lit up. “We could pass a pointer!”

“Exactly!” Angelo grinned. “Instead of copying the whole array, we pass a pointer to its first element. That way, the function works with the same memory, instead of making unnecessary copies.”

He leaned forward, typing on his laptop. “Now, let’s try rewriting your minimum function using this approach. Here’s the structure of what it should look like:

int minimum(int* arr, int size) {
   ...
}

int main(void) {
   ...
   printf("%d\n", minimum(arr, 5));
   ...
}

“Got it?”

They both nodded.

“Alright, now try to write it yourselves. No peeking!”

He smirked and turned his screen away, but after a moment, he added, “Just in case you get stuck, here’s the full solution.”

int minimum(int* arr, int size) {
  int cand = arr[0];
  int i = 1;
  while(i < size) {
    if(arr[i] < cand) {
      cand = arr[i];
    }
    i++;
  }
  return cand;
}
 
int main(void)
{
  int arr[5];
  arr[0] = 22;
  arr[1] = 44;
  arr[2] = 12;
  arr[3] = 99;
  arr[4] = 56;
 
  printf("%d\n", minimum(arr, 5));
  return 0;
}

Jasmina and Leo exchanged determined looks and got to work.

As Leo typed out his function, something caught his eye. He glanced at Angelo’s example and noticed something odd.

“Wait a second,” Leo said, frowning. “I thought we were supposed to use pointers, but in your function, you’re using arr[i] instead of *arr. Doesn’t that mean you’re accessing the array directly?”

Angelo grinned. “Ah, good catch! But here’s the thing—arrays and pointers are actually the same thing in C. When you write arr[i], it’s really just a shorthand for *(arr + i). The compiler treats them the same way.”

Leo’s eyes widened. “So whenever I use array notation with brackets, I’m actually just using pointer arithmetic behind the scenes?”

“Exactly!” Angelo nodded. “That’s one of the quirks of C. Arrays and pointers are deeply connected. You can even use pointer notation with an array, or vice versa—both work. The brackets just make things easier to read.”

Jasmina smirked. “So C just lets us pretend we’re working with arrays, but really, we’re just moving pointers around?”

“Pretty much,” Angelo said with a chuckle.


Angelo leaned back in his chair, stretching his arms. “Alright, up until now, you’ve been working with integers and integer arrays. But strings work a little differently.”

Jasmina perked up. “Strings? You mean, just arrays of characters, right?”

Angelo nodded. “Exactly. In C, a string is really just an array of char values. A char is simply an 8-bit integer, meaning each character is stored as a single byte. And just like any other array, it’s stored in memory as a sequence of bytes. The main difference is that strings in C are always null-terminated, meaning they end with a 0 byte.”

Jasmina’s eyes lit up. “That’s exactly how we handled strings in assembly!”

“Yep, same principle,” Angelo said. “But here’s where things start getting tricky. When you write a string using quotes, like "Hello", it isn’t stored on the stack like your integer arrays. Instead, it gets placed in a special part of memory reserved for constants—meaning it stays there for the whole duration of the program.”

Leo frowned. “Wait, so if I create a string inside a function, it won’t automatically disappear when the function returns?”

“Depends,” Angelo explained. “If you declare a string like this:

char str[] = "Hello";

then it is stored on the stack because you’re explicitly creating an array. But if you do this instead:

char* str = "Hello";

then str is just a pointer to a constant string in memory. The string itself won’t disappear, but the pointer can be changed to point somewhere else.”

Sebastian nodded slowly. “So that’s the difference between using [] and * with strings?”

“Exactly.”

Jasmina was thinking hard. “But what if we don’t know how big the string is ahead of time? What if we need to create a new one that’s longer or shorter depending on the situation?”

Angelo grinned. “Now you’re asking the right questions. See, up until now, you’ve been working with arrays that have a fixed size. That’s fine when you know in advance how much space you need, but sometimes you don’t. That happens a lot when dealing with strings.”

Leo thought for a moment. “So… we need a way to allocate memory dynamically?”

“Exactly,” Angelo said. “There’s a special function in C called malloc. It lets you request a chunk of memory at runtime. You tell it how many bytes you need, and it gives you a pointer to the newly allocated space.”

Jasmina raised an eyebrow. “And if we don’t need it anymore?”

“Then you have to free it yourself, using free(). Otherwise, you’re wasting memory.”

Sebastian leaned back. “So if we don’t free it, that memory just… stays used?”

“Yep. The operating system won’t take it back until your program exits. That’s called a memory leak, and it can be a big problem if you keep allocating memory without freeing it.”

Jasmina nodded. “Okay, so let’s say we want to put two strings together—like "hello " and "world"—into one new string. We don’t know the size in advance, so we’ll have to allocate space dynamically, right?”

Angelo snapped his fingers. “Exactly. To concatenate two strings, we need enough space for both strings, plus one extra byte for the null terminator at the end.”

Jasmina counted on her fingers. “So the new string’s size should be the length of the first string… plus the length of the second string… plus one?”

“Exactly!” Angelo said. “Let’s write a function to do that. It’ll take two strings as input, allocate memory for a new string, copy both strings into it, and return the new string.”

He wrote down the function signature:

char* concatenate(
  const char* s1,
  const char* s2
);

Leo frowned. “What’s with the const?”

“Good catch,” Angelo said. “It just means that the function promises not to modify the original strings. It’s just a safety measure to prevent accidental changes. Now, let’s implement this function together.”

Angelo leaned forward, resting his elbows on the table. “Alright, the first thing you’ll need is a function to determine the length of a string. Here’s how we define it:”

int length(char* str)

Jasmina considered it for a moment. “So we just need to walk through the string until we find the null terminator, the 0 byte?”

“Exactly,” Angelo confirmed. “Since C strings are just arrays of characters ending in 0, you can count the characters until you hit the null terminator.”

Sebastian nodded. “Once you have that function, you’ll be able to write another function—concatenate—that takes two strings and joins them together into a new one.”

“Wait,” Leo said, “if we’re creating a new string, we need to allocate memory for it, right?”

“Yep, and that’s where malloc comes in,” Angelo explained. “malloc is a function that lets you request a chunk of memory from the system. Since it’s part of the standard C library, we need to include its header at the top of the program like this:”

#include <malloc.h>

Jasmina’s eyes lit up. “Oh! That’s just like #include <stdio.h>. I always wondered what that was for.”

“Good question,” Angelo said. “stdio.h stands for ‘standard input/output.’ It’s a library that provides functions like printf, which lets us print text to the screen.”

Leo frowned. “But I thought printf was handled by the kernel? Isn’t it a system call?”

“Not exactly,” Angelo said. “printf does a lot of extra work—it formats the string, processes special characters, and only then calls a lower-level function that interacts with the kernel. The actual system call happens deep inside printf, but for us, we just use it as a function from the standard library.”

Jasmina nodded. “That makes sense. The compiler wouldn’t just assume every function exists—it needs them to be explicitly declared.”

“Exactly,” Angelo said. “Alright, here’s the full solution. Try implementing it yourself before looking at the code.”


Solution:

#include <stdio.h>
#include <malloc.h>

int length(char* str) {
  int i = 0;
  while (str[i] != 0) {
    i++;
  }
  return i;
}
char* concatenate(char* str1, char* str2) {
  int i = 0, j = 0;

  // Allocate memory for the new string
  // (+1 for the null terminator)
  char* result = malloc(
    length(str1) + length(str2) + 1
  );

  // Copy the first string
  while (str1[j] != 0) {
    result[i] = str1[j];
    i++;
    j++;
  }

  // Copy the second string
  j = 0;
  while (str2[j] != 0) {
    result[i] = str2[j];
    i++;
    j++;
  }

  // Null-terminate the new string
  result[i] = 0;

  return result;
}
int main(void) {
  char* hello = "Hello ";
  char* world = "world!";
  char* msg = concatenate(hello, world);
  printf("%s\n", msg);
  free(msg);
  return 0;
}