Created
July 8, 2013 20:28
-
-
Save apokalyptik/5952215 to your computer and use it in GitHub Desktop.
Super simple and informative exmple of using CGO
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
package main | |
// #include <ctype.h> | |
import "C" | |
import "log" | |
func main() { | |
for i := 32; i<126; i=i+1 { | |
log.Printf( "'%s' (%3d) isalpha: \t%d", string(byte(i)), i, C.isalpha(C.int(i)) ) | |
} | |
} |
Author
apokalyptik
commented
Jul 8, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment