source: CIVL/mods/dev.civl.abc/examples/enum1.c

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 321 bytes
Line 
1#include<stdio.h>
2
3enum a {A};
4enum a; // refers to same enum as above
5
6int main() {
7 enum a x=A; // refers to enum above in root scope
8 printf("%d\n", x); // prints 0
9 enum a {B,A}; // a new enum in this scope
10 enum a y=A; // refers to new enum and new A in this scope
11 printf("%d\n", y); // prints 1
12 return 0;
13}
Note: See TracBrowser for help on using the repository browser.