Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(847)

Side by Side Diff: doc/progs/cgo2.go

Issue 5777054: code review 5777054: doc: add C? Go? Cgo! article (Closed)
Patch Set: diff -r e07bc909079c https://code.google.com/p/go Created 13 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « doc/progs/cgo1.go ('k') | doc/progs/cgo3.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 package rand2
5
6 /*
7 #include <stdlib.h>
8 */
9 import "C"
10
11 func Random() int {
12 var r C.long = C.random()
13 return int(r)
14 }
15
16 // STOP OMIT
17 func Seed(i int) {
18 C.srandom(C.uint(i))
19 }
20
21 // END OMIT
OLDNEW
« no previous file with comments | « doc/progs/cgo1.go ('k') | doc/progs/cgo3.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b