diff options
| author | Cody <cody@codyq.dev> | 2023-06-26 23:41:21 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-06-26 23:41:21 -0500 |
| commit | a3c5134ee7581168947df8a050c332d7cb7aa426 (patch) | |
| tree | 01631812f37e4c3d124928a14f169796c58a7a0e /test.c | |
| parent | 8c9bd55e161ba5fcaea626a1db2e0b685ac4f096 (diff) | |
| download | sloth-a3c5134ee7581168947df8a050c332d7cb7aa426.tar.gz | |
Strings and so much more
Diffstat (limited to 'test.c')
| -rw-r--r-- | test.c | 60 |
1 files changed, 13 insertions, 47 deletions
@@ -1,53 +1,19 @@ #include <stdio.h> -typedef struct { - int size; - int cap; - int* inner; -} IntVec; - -IntVec* test(); -int testtwo(IntVec*); -int testthree(IntVec*); -int testfour(IntVec*); - -void testback(int x) { - printf("%d, ", x); +void print(char* x) { + printf("%s", x); +} +void printfl(float x) { + printf("%f", x); +} +void printint(int x) { + printf("%d", x); } -int main() { - IntVec* v = test(); - - int size = (*v).size; - int cap = (*v).cap; - int* inner = (*v).inner; - - printf("%d\n", size); - printf("%d\n", cap); - - for (int i = 0; i < size; ++i) { - int value = inner[i]; - printf("%d ", value); - } - puts("\n\n"); - - testtwo(v); - - size = (*v).size; - cap = (*v).cap; - inner = (*v).inner; - - printf("%d\n", size); - printf("%d\n", cap); +int as_int(float x) { + return (int) x; +} - for (int i = 0; i < size; ++i) { - int value = inner[i]; - printf("%d ", value); - } - puts("\n\n"); - int i = testthree(v); - printf("%d ", i); - puts("\n\n"); - testfour(v); - puts(""); +void termpos(int x, int y) { + printf("\x1b[%d;%dH", x, y); } |
