[Assorted-commits] SF.net SVN: assorted:[1059] sandbox/trunk/src/c/write_stdin.c
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-11-06 08:42:48
|
Revision: 1059 http://assorted.svn.sourceforge.net/assorted/?rev=1059&view=rev Author: yangzhang Date: 2008-11-06 08:42:43 +0000 (Thu, 06 Nov 2008) Log Message: ----------- demo writing stdin Added Paths: ----------- sandbox/trunk/src/c/write_stdin.c Added: sandbox/trunk/src/c/write_stdin.c =================================================================== --- sandbox/trunk/src/c/write_stdin.c (rev 0) +++ sandbox/trunk/src/c/write_stdin.c 2008-11-06 08:42:43 UTC (rev 1059) @@ -0,0 +1,12 @@ +// What happens if we try writing to stdin? + +#include <unistd.h> + +int +main() +{ + char msg[] = "hello, world!\n"; + // This will actually print something out to the console! + write(0, msg, sizeof msg); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |