I am creating one small C program which is used for performing addition and some mathematical calculations. My doubt is if I want to calculate any thing in that program first I have to compile that program, then i can able to get the answer. Without compiling can I give that input numbers? If we are opening calculator in computer(window s xp) first we gave the input numbers then it shows the corresponding output. So like that can I do something similar in C?
convert codings to software
Collapse
X
-
-
You can do that by passing command-line arguments to your C program.
For example, consider this (MyCalc is your calculator executable):
C:\> MyCalc.exe multiply 2 5
>>> 10
Here multiply, 2, and 5 are command-line arguments, and your program functions according to them.
See this google link for informatin on the subject.
Comment