Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dipiert/the-pragmatic-programmer_my-exercises
https://github.com/dipiert/the-pragmatic-programmer_my-exercises
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dipiert/the-pragmatic-programmer_my-exercises
- Owner: Dipiert
- Created: 2017-11-27T15:41:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-27T15:48:38.000Z (about 7 years ago)
- Last Synced: 2024-11-06T11:00:40.367Z (about 2 months ago)
- Language: C
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Exercise 11
Your C program uses an enumerated type to represent one of 100 states.
You’d like to be able to print out the state as a string (as opposed to a
number) for debugging purposes. Write a script that reads from standard
input a file containing```
name
state_a
state_b
:
:
```
Produce the file name.h, which contains```
extern const char* NAME_names[];
typedef enum {
state_a,
state_b,
:
:
} NAME;
```and the file name.c, which contains
```
const char* NAME_names[] = {
"state_a",
"state_b",
:
:
};
```