Learning C, Day 2

So I spent about 2 hours today learning C and I finally got to pointers. C is so quirky and I love it. I finished the first tutorial and now I’m reading Modern C by Jens Gustedt. I’m working on a text adventure game and I’m googling how to do almost everything. Most of the time I don’t understand the answers, so that’s why I’m reading the book.

I noticed that pointers are slightly similar to something I can do with Windows Batch: storing a variable name in a variable.

@echo off & setlocal enabledelayedexpansion

set a=Hello there
set b=a
echo !%b%!

I know it looks like b gets a’s value, but b contains “a” literal. The interpreter expands b to “a” and then expands “a” as a variable to “Hello there”. Anyway, I’ll see you tomorrow!

Leave a comment

Your email address will not be published. Required fields are marked *


Your data is processed in accordance with my privacy policy. Comments are manually approved and may take a while to appear.