improve the CSV example

Fri, 07 Jul 2023 20:22:30 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 07 Jul 2023 20:22:30 +0200
changeset 746
b4bd0155f03f
parent 745
c99abca90d21
child 747
1bd48834e490

improve the CSV example

docs/src/features.md file | annotate | diff | comparison | revisions
--- a/docs/src/features.md	Fri Jul 07 20:20:03 2023 +0200
+++ b/docs/src/features.md	Fri Jul 07 20:22:30 2023 +0200
@@ -148,11 +148,11 @@
             cxMempoolDestroy(pool);
             return 1;
         }
-        CSVData* data = cxMalloc(pool->allocator, sizeof(CSVData));
-        data->column_a = fields[0];
-        data->column_b = fields[1];
-        data->column_c = fields[2];
-        cxListAdd(datalist, data);
+        CSVData data;
+        data.column_a = fields[0];
+        data.column_b = fields[1];
+        data.column_c = fields[2];
+        cxListAdd(datalist, &data);
     }
 
     // iterate through the list and output the data

mercurial