Comments (3)
I working for this issue at this week
from c2go.
Some example:
#include<stdio.h>
enum week{Mon, Tue, Wed};
int main()
{
enum week day;
day = Wed;
printf("%d",day); // result is : 2
return 0;
}
#include<stdio.h>
enum year{Jan, Feb, Mar, Apr, May, Jun, Jul,
Aug, Sep, Oct, Nov, Dec};
int main()
{
int i;
for (i=Jan; i<=Dec; i++)
printf("%d ", i);
return 0;
}
#include <stdio.h>
enum State {Working = 1, Failed = 0, Freezed = 0};
int main()
{
printf("%d, %d, %d", Working, Failed, Freezed); // result : 1, 0, 0
return 0;
}
#include <stdio.h>
enum day {sunday, monday, tuesday, wednesday, thursday, friday, saturday};
int main()
{
enum day d = thursday;
printf("The day number stored in d is %d", d); //Result : The day number stored in d is 4
return 0;
}
#include <stdio.h>
enum day {sunday = 1, monday, tuesday = 5,
wednesday, thursday = 10, friday, saturday};
int main(){
printf("%d %d %d %d %d %d %d", sunday, monday, tuesday,
wednesday, thursday, friday, saturday); // Result : 1 2 5 6 10 11 12
return 0;}
#include <stdio.h>
enum State {WORKING = 0, FAILED, FREEZED};
enum State currState = 2;
enum State FindState() { return currState;}
int main() {
(FindState() == WORKING)? printf("WORKING"): printf("NOT WORKING");
return 0;
}
Examples from http://www.geeksforgeeks.org/enumeration-enum-c/
from c2go.
Ready for check
from c2go.
Related Issues (20)
- panic: unknown node type: 'MSAllocatorAttr 0x21a234729f0 <line:420:25>' HOT 1
- How to handle dependencies? HOT 2
- panic: could not match regexp with string HOT 1
- panic: unknown node type: 'CallbackAttr 0x562b0bc30c88 <line:199:12> Implicit 2 3'
- Cannot tranpile (sic)
- panic: unknown node type: ColdAttr HOT 1
- __int128 is translated as int64
- panic: unknown node type: BuiltinAttr HOT 2
- panic: unknown node type: 'BuiltinAttr 0x7fb08f04f838 <<invalid sloc>> Inherited Implicit 720' HOT 2
- panic: could not match regexp with string (translation_unit_decl) HOT 2
- 'const' removed from struct name / cannot determine sizeof union HOT 2
- docker container for c2go HOT 8
- panic: runtime error: invalid memory address or nil pointer dereference
- An alternative to github.com/elliotchance/c2go HOT 1
- panic: unknown node type: 'BuiltinAttr 0x10db7b0 <<invalid sloc>> Inherited Implicit 749' HOT 1
- FreeBSD implementation
- panic: unknown node type: 'BuiltinAttr 0x1d448112da0 <<invalid sloc>> Implicit 836' HOT 3
- Installation of c2go HOT 3
- Is it possible to convert .cpp aswell? HOT 1
- Compile `pikchr` source code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2go.