Lindsey Kuper (lindseykuper) wrote,
Lindsey Kuper
lindseykuper

Lindsey's concise guide to pointer types in C

Between work and class, I'm finally starting to get my C legs.1 For your edification, then, I present here a useful guide:

pointer to int
Haha. Ahahahahahah. Heh. *snort* Oh man. Okay. By "pointer to int", we mean "variable containing an address containing something that has type int". Except...no, wait, that's not it either. That's just what we want you to think. What we actually mean is "variable containing an address whose contents could be anything at all, but which we currently plan on interpreting as an int, not to say that we don't fully intend to change our minds in the future, possibly several times, and not to say that said contents themselves won't change, possibly several times."
pointer to char
See "pointer to int", mutatis mutandis.
pointer to long
See above.
pointer to void
Um...anything whatsoever. Seriously, this is just whatever the hell you want it to be.2

The rest is basically the same, so I'll just stop there. Enjoy!


  1. Ba-dum-ch!
  2. Come on! I mean, why have a type system at all? What is wrong with you people?
Tags: programming
Subscribe

  • The Rust object system struggles to its feet (plus, a little brainteaser)

    When I last wrote about my work on Rust a month ago, I had just finished implementing some very basic support for extending Rust objects with new…

  • Redexing

    For the last two weeks at work, my little PLT Redex model of Rust has been taking shape. It's been a lot of fun. I started with lambda calculus,…

  • My first month at Mozilla

    As it turns out, I picked an interesting month to start working at Mozilla. On Tuesday of my second week, Firefox 4 launched, followed by the…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 26 comments

  • The Rust object system struggles to its feet (plus, a little brainteaser)

    When I last wrote about my work on Rust a month ago, I had just finished implementing some very basic support for extending Rust objects with new…

  • Redexing

    For the last two weeks at work, my little PLT Redex model of Rust has been taking shape. It's been a lot of fun. I started with lambda calculus,…

  • My first month at Mozilla

    As it turns out, I picked an interesting month to start working at Mozilla. On Tuesday of my second week, Firefox 4 launched, followed by the…