diff --git a/array-dim2/main.c b/array-dim2/main.c new file mode 100644 index 0000000..111da29 --- /dev/null +++ b/array-dim2/main.c @@ -0,0 +1,35 @@ +#include + +int main(int argc, char *argv[]) { + fprintf(stdout,"main() Started...\n"); + + json_t *arrayArray, *arrayInt, *integer1, *integer2; + size_t sizeArAr, sizeArInt; + + arrayInt = json_array(); + + integer1 = json_integer(42); + integer2 = json_integer(23); + + json_array_append(arrayInt, integer1); + json_array_append(arrayInt, integer2); + + json_decref(integer1); + json_decref(integer2); + + sizeArInt = json_array_size(arrayInt); + fprintf(stdout,"main() size(arrayInt): %ld\n", sizeArInt); + + arrayArray = json_array(); + + json_array_append(arrayArray, arrayInt); + + json_decref(arrayInt); + + + sizeArAr = json_array_size(arrayArray); + fprintf(stdout,"main() size(arrayArray): %ld\n", sizeArAr); + + fprintf(stdout,"main() Done.\n"); + return 0; +} diff --git a/array-dim2/makefile b/array-dim2/makefile new file mode 100644 index 0000000..8fed1b4 --- /dev/null +++ b/array-dim2/makefile @@ -0,0 +1,24 @@ +# Docu +# +#$@ is the name of the file to be made +#$? is the names of the changed dependents +#$< the name of the related file that caused the action +#$* the prefix shared by target and dependent files +# +# Others +RM = /bin/rm -f +# +# Source, Executable, Includes, Library Defines +EXE = main +# +# Compiler, Linker Defines +CC = /usr/bin/gcc +# +all: main.o + $(CC) main.c -L/usr/lib/x86_64-linux-gnu -ljansson -Wall -o $(EXE) +# +main.o: + $(CC) -c main.c +# Clean Up Objects, Exectuables, Dumps out of source directory +clean: + $(RM) *.o $(EXE) *~ diff --git a/array-dim2/readme.md b/array-dim2/readme.md new file mode 100644 index 0000000..f0c3946 --- /dev/null +++ b/array-dim2/readme.md @@ -0,0 +1,17 @@ +* build + +``` +make clean all +``` + +* cleanup + +``` +make clean +``` + +* run + +``` +./main +```