diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-14 14:14:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-14 14:14:54 +0000 |
commit | ee2220174467b0e456446f5faaef1bd1660f786e (patch) | |
tree | 61937f54d7558e15f984b0450c2958e9ed45b5bd /apps/hello | |
parent | 38121cceb67b2408c5aab1d3e9998accef0d83c8 (diff) | |
download | nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.gz nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.tar.bz2 nuttx-ee2220174467b0e456446f5faaef1bd1660f786e.zip |
VSN/apps update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3378 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/hello')
-rw-r--r-- | apps/hello/hello.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/apps/hello/hello.c b/apps/hello/hello.c index d7818d351..fb94d0ea9 100644 --- a/apps/hello/hello.c +++ b/apps/hello/hello.c @@ -34,6 +34,24 @@ ****************************************************************************/ #include <stdio.h> +#include <stdlib.h> + + +void memtest(void) +{ + char *p; + int i, j; + + for (i=0; i<1000; i++) { + p = malloc(40000); + if (!p) { + printf("No memory\n"); + break; + } + for (j=0; j<40000; j++) p[j] = 0; + free(p); + } +} /** Example of a standalone application @@ -41,7 +59,17 @@ int hello_main(int argc, char *argv[]) { int i; - printf("Hello Builtin Application\nFound argc=%d arguments and are as follows:\n", argc); - for (i=0; i<argc; i++) printf("%s\n", argv[i]); + + printf("Hello Builtin Application\n" + "Found argc=%d arguments and are as follows:\n", argc); + + // note that stdout is bufferred and that fflush() and is called on exit. + fflush(stdout); + + for (i=0; i<argc; i++) + printf("%s\n", argv[i]); + + //memtest(); + return 0; } |