This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <math.h> | |
| #include <ctype.h> | |
| /* | |
| code is from the book, i changed atof function to | |
| make it handle scientific notations like : | |
| "123.45e-6" | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| /* | |
| code is from the book i only modified strindex, | |
| which now returns rightmost occurrence of t in s | |
| */ | |
| #define MAXLINE 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <limits.h> | |
| /* | |
| code is from the book, i only added minimal witdth -- w | |
| */ | |
| void itoa(int n, char s[], int w); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| /* | |
| itob(n,s,b) converts the integer n into a base | |
| b character representation in the string s. | |
| b could be up to 36. after that we run out of letters. | |
| */ | |
| void itob(int n, char h[], int b); | |
| void reverse(char s[], int len); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void expand(char s1[], char s2[]); | |
| void expand(char s1[], char s2[]) { | |
| int i, j, l; | |
| char start, end; | |
| start = end = '\0'; | |
| l = 0; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| /* | |
| this is supposed to return first location in | |
| string s1 where any character from the string | |
| s2 occurs, or -1 if no such occurances exist. | |
| */ | |
| int any(char s1[], char s2[]); | |
| int any(char s1[], char s2[]){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| /* | |
| this is supposed to remove any character in | |
| string s, which also happens to be in string c | |
| */ | |
| #define IN 1 | |
| #define OUT 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <ctype.h> | |
| int expo(int x, int y); | |
| int atoi(char c); | |
| int htoi(char s[]); | |
| void main() { | |
| printf("%d\n", htoi("62Fa")); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define ARRLEN 1000 | |
| #define IN 1 /* in a comment */ | |
| #define OUT 0 /* out of a comment */ | |
| /* removes comments from c program(only /* style commnets) */ | |
| int get_line(char s[], int lim); | |
| int get_line(char s[], int lim) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define TABLEN 4 | |
| #define ARRLEN 1000 | |
| int get_line(char s[], int lim); | |
| /* program for replacing tabs with appropriate number of | |
| blank characters */ |
NewerOlder