Skip to content

Instantly share code, notes, and snippets.

@emadflash
Created August 7, 2021 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emadflash/2e6c75a5118be9b0942b5a2bfd90eccf to your computer and use it in GitHub Desktop.
Save emadflash/2e6c75a5118be9b0942b5a2bfd90eccf to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdbool.h>
void While(bool *func()) {
LOOP:
if (func()) {
goto LOOP;
} else {
goto DONE;
}
DONE:
return;
}
bool Cond() {
int i;
if (i < 10) {
printf("%d ", i++);
return true;
}
return false;
}
int main() {
int i = 0;
While(Cond);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment