Skip to content

Instantly share code, notes, and snippets.

@eevee
Created November 1, 2012 17:50
Show Gist options
  • Save eevee/3995350 to your computer and use it in GitHub Desktop.
Save eevee/3995350 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <term.h>
void main() {
char** p = boolnames;
while (*p != NULL) {
printf("%p %p %c %s\n", p, *p, **p, *p);
p++;
}
}
// compiled with -lncursesw
use libc::c_char;
#[link_args = "-lncursesw"]
extern {
const boolnames: **c_char;
}
fn main() {
let mut p: **c_char = boolnames;
unsafe {
while *p != ptr::null() {
io::println(fmt!("%x %x %c %s", p as uint, *p as uint, **p as char, str::raw::from_c_str(*p)));
p = ptr::offset(p, 1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment