Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc,const char *argv[])
- {
- FILE *src = input_from_args(argc, argv);
- if (src == NULL)
- {
- printf("%s", "Invalid Source");
- exit(EXIT_FAILURE);
- }
- else
- {
- struct stack * equation = NULL;
- equation = (struct stack*)malloc(sizeof(struct stack));
- equation -> top = -1;
- int i;
- int c;
- while( argv[i] != NULL)
- {
- c = *argv[i];
- i++;
- push(equation,c);
- }
- if(strcmp(argv[1],"-e") == 0)
- {
- evaluate(equation);
- printf("%i n", pop(equation));
- }
- else if(strcmp(argv[1],"-c") == 0)
- {
- convert(equation);
- }
- else if(strcmp(argv[1],"-g") == 0)
- {
- other(equation);
- }
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement