1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include "clog.h"
// SNIP
void print_string(void* a_value) {
char* s = a_value; // No typecast needed because in C, you can…
// ∙ Assign a void* to a variable declared as ▒▒▒▒*, or
// ∙ Assign a ▒▒▒▒* to a variable declared as void*, or
printf("\"%s\"", s);
}
// SNIP
int main(int argc, char* argv[]) {
int n = 65;
print_string(&n);
return EXIT_SUCCESS;
}
|
© Copyright 2022 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.