/* Exercise 3-3. Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2. Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0−9 and -a-z. Arrange that a leading or trailing - is taken literally. */ #include #include #define MAXLINE 1000 /* maximum output line size */ int my_getline(char s[], int lim); void expand(char s1[], char s2[]); /* testing code */ main() { char s1[MAXLINE], s2[MAXLINE]; while (my_getline(s1, MAXLINE) > 0) { expand(s1, s2); printf("%s", s2); } return 0; } /* getline: read a line into s, return length */ int my_getline(char s[], int lim) { int c, i; for (i=0; i