mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-10-28 22:58:15 -04:00
Add new PascalStringArray type
This commit is contained in:
1 parent
b956f71b17
commit
cefdb30193
6 files changed
+36
-45
No files matched your search
@@ -53,13 +53,13 @@ int main() {
|
||||
exit(1); // result.r0 not freed since program exits
|
||||
}
|
||||
|
||||
for (int i = 0; i < result.r2; i++) {
|
||||
for (int i = 0; i < result.r1.len; i++) {
|
||||
// print Pascal string using "%.*s" with printf and supplying both length and data
|
||||
printf("%.*s\n", result.r1[i].len, result.r1[i].data);
|
||||
printf("%.*s\n", result.r1.data[i].len, result.r1.data[i].data);
|
||||
}
|
||||
|
||||
// be sure to free the data!
|
||||
FreeArray(result.r1, result.r2);
|
||||
FreeArray(result.r1);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user