How can make it so the program reads any two integers input before the program is run?
I want the output to look like this, with x
and y
being any variables typed in (I am using Cygwin):
$ ./a x y
(product of x and y)
(sum of x and y)
I used int main(int argc, char *argv[])
. I tried to assign argv[2]
to x
and argv[3]
to y
, but when I compile the program it says assignment makes integer from pointer without cast. What does this mean and how do I fix it?