Skip to content

Instantly share code, notes, and snippets.

@clarknelson
Created October 1, 2013 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarknelson/6786511 to your computer and use it in GitHub Desktop.
Save clarknelson/6786511 to your computer and use it in GitHub Desktop.
lab1.c
#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