C:\Windows\System32>"E:\CS I\a.exe"
Enter three integers and I will display their sum: 0
0
0
0
Also, btw, x = 1
C:\Windows\System32>echo %ERRORLEVEL% // return value (normally 0)
124234
C:\Windows\System32>"E:\CS I\a.exe" 2
Enter three integers and I will display their sum: 10
10
10
30
Also, btw, x = 2
C:\Windows\System32>"E:\CS I\a.exe" 3
Enter three integers and I will display their sum:
-
1956814207
Also, btw, x = 2
C:\Windows\System32>"E:\CS I\a.exe" 3
Enter three integers and I will display their sum: 0
0
0
0
Also, btw, x = 2
C:\Windows\System32>"E:\CS I\a.exe" 3 3 4 5 1 3 4
Enter three integers and I will display their sum: 0
0
0
0
Also, btw, x = 8
C:\Windows\System32>
My problem is I do not understand what is going on when I try to pass an argument to the program. (Since it is defined int main(int x)).
There is no such function signature by standard definition. You must use int main(int argc, char **argv) else undefined behavior will happen when you try to use either argument.
This is actually a quirk of how C functions work. I won't go into details here but your actually seeing the result of the "argc" argument which is how many parameters you're passing to the program including the program itself (which should mostly be 1 or above).
If you want to pass an integer, you must use the above mentioned function signature, then figure out how to cast the string of the integer you want to an actual data represented integer.