Created
October 1, 2013 22:53
-
-
Save clarknelson/6786511 to your computer and use it in GitHub Desktop.
lab1.c
This file contains 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 <stdlib.h> | |
#include <string.h> | |
char *interpret_set(const char *input_set) | |
{ | |
int counter; | |
int length = strlen(input_set); | |
char output[100]; | |
for(counter = 0; counter<length; counter++){ | |
output[counter] = input_set[counter]; | |
if( (output[counter] = "t")){ | |
printf("%s\n", "success"); | |
} else { | |
printf("%s\n", "fail"); | |
} | |
} | |
return 0; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
if (argc > 3) { | |
printf("You entered too many arguements, please submit mytr in this format. \n Usage: mytr [-d] SET1 [SET2]"); | |
} else if(argc < 3) { | |
printf("You entered too few arguements, please submit mytr in this format. \n Usage: mytr [-d] SET1 [SET2]"); | |
} else { | |
interpret_set(argv[1]); | |
} | |
return -1; | |
} | |
int charpos(const char character, const char *char_set) | |
{ | |
return 1; | |
} | |
//int ch; | |
//char *omit ="aeiou"; | |
//while ((ch=getchar()) != EOF) { | |
// if (!strchr(omit,ch)) | |
// putchar(ch); | |
//} | |
//-input=Hello world! Agghh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment