Permalink
Browse files

new file

  • Loading branch information...
1 parent 3aa8296 commit 86905f6de9d24a8b986247eb6b74fa537b1aa514 @dlinyj committed Oct 6, 2016
Showing with 67 additions and 0 deletions.
  1. +11 −0 asmexample/Makefile
  2. +14 −0 remote/remote.c
  3. +8 −0 var/Makefile
  4. +34 −0 var/var.c
View
@@ -0,0 +1,11 @@
+# Makefile for Hello World project
+#
+
+all: asmexample
+
+asmexample: asmexample.c
+ gcc -o asmexample -g asmexample.c
+
+clean:
+ rm -f *.o asmexample
+
View
@@ -0,0 +1,14 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ int a[] = {1, 2, 3};
+ int i=0;
+ printf("pid=%d\n", getpid());
+ while (1) {
+ sleep(1);
+ printf("i=%d\n",i);
+ }
+ return 0;
+}
View
@@ -0,0 +1,8 @@
+# Makefile for Hello World project
+#
+abort: var.c
+ gcc -o var -g var.c
+
+clean:
+ rm -f *.o var
+
View
@@ -0,0 +1,34 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+
+void print_count(int count) {
+ printf("count=%d\n", count);
+}
+
+int print_var (int var){
+ static int count=0;
+ printf("var=%d\n",var);
+ count++;
+ print_count(count);
+ return count;
+}
+
+int main(int argc, char * argv[])
+{
+ int var, c;
+ if (argc < 2) {
+ printf("Usage: %s command, [arg1 [arg2]...]\n", argv[0]);
+ return EXIT_FAILURE;
+ }
+ printf("Our param == %s...\n", argv[1]);
+ var=100;
+ c=print_var(var);
+ var+=c;
+ print_var(var);
+ return 0;
+}
+
+//

0 comments on commit 86905f6

Please sign in to comment.