Untitled
unknown
plain_text
a year ago
350 B
8
Indexable
#include <stdio.h>
#include <stdbool.h>
// Define a struct
struct being {
bool alive;
};
void kill(struct being *b) {
if (!b->alive) {
printf("Killing self...\n");
}
}
int main() {
struct being is_alive = { true }; //instance
//kill func
kill(&my_being); //you can also move the alive boolean outside it
}Editor is loading...
Leave a Comment