I am trying to make a command line calculator, and I made up a partial code for it, just for adding numbers, I am jsut taking it one step at a time. But I am suppose a number then a space then the math function then a space then the second number. But for some reason I am always getting one for the output. Can anybody tell me what I am doing wrong with this.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
main(int argc, char *argv)
{
int answer;
if(argv[2]=='+')
answer=argv[1]+argv[3];
printf("%i",answer);
}