Skip to content

Commit

Permalink
Create Inline-break.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
theSoberSobber authored Aug 15, 2024
1 parent de92025 commit 45e5f0b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions codes/Inline-break.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//Inline Break
//Inline Break by defining break to a function that basically breaks but returns value and hence can be used as a expression with comma operator

static inline int break_(void) {
extern void abort(void);
abort();
return 0;
}
#define break break_

int main(int c, char **v) {
int yay = 1;
for (int i = 0; ++i < c;)
if (v[i][0] == '1') yay = 0, break;
return yay;
}

0 comments on commit 45e5f0b

Please sign in to comment.