Created
November 1, 2012 17:50
-
-
Save eevee/3995350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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