summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/demos.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-30 12:36:13 +0100
committerTyge Løvset <[email protected]>2022-12-30 14:38:39 +0100
commit4f0f45422fb58e9b134445ad6a4ea96d806214e8 (patch)
treeea0bb95c1f82fa5ec71218ce1f6d7ce9bfcc4e29 /misc/examples/demos.c
parent0761c13f316cc98ae7756f3527931aa86bed5016 (diff)
downloadSTC-modified-4f0f45422fb58e9b134445ad6a4ea96d806214e8.tar.gz
STC-modified-4f0f45422fb58e9b134445ad6a4ea96d806214e8.zip
More restructuring of files and cleanup. Moved carr2.h and carr3.h to misc/include/old/ as it is not among classic containers.
Removed stctest.h: Recommending https://github.com/bvdberg/ctest instead.
Diffstat (limited to 'misc/examples/demos.c')
-rw-r--r--misc/examples/demos.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/misc/examples/demos.c b/misc/examples/demos.c
index 4a9fac89..4455b840 100644
--- a/misc/examples/demos.c
+++ b/misc/examples/demos.c
@@ -185,35 +185,6 @@ void mapdemo3()
cmap_str_drop(&table); // frees key and value cstrs, and hash table.
}
-#define i_val float
-#define i_tag f
-#include <stc/carr3.h>
-
-void arraydemo1()
-{
- printf("\nARRAYDEMO1\n");
- c_WITH (carr3_f arr3 = carr3_f_with_size(30, 20, 10, 0.0f),
- carr3_f_drop(&arr3))
- {
- arr3.data[5][4][3] = 10.2f;
- float **arr2 = arr3.data[5];
- float *arr1 = arr3.data[5][4];
-
- printf("arr3: %" c_ZU ": (%" c_ZU ", %" c_ZU ", %" c_ZU ") = %" c_ZU "\n", sizeof(arr3),
- arr3.xdim, arr3.ydim, arr3.zdim, carr3_f_size(&arr3));
-
- printf("%g\n", arr1[3]); // = 10.2
- printf("%g\n", arr2[4][3]); // = 10.2
- printf("%g\n", arr3.data[5][4][3]); // = 10.2
-
- float x = 0.0;
- c_FOREACH (i, carr3_f, arr3)
- *i.ref = ++x;
- printf("%g\n", arr3.data[29][19][9]); // = 6000
- }
-}
-
-
int main()
{
stringdemo1();
@@ -224,5 +195,4 @@ int main()
mapdemo1();
mapdemo2();
mapdemo3();
- arraydemo1();
}