Assuming this to be a Console app, Your Main() method has a args as
string() parameter. Within
this method you can read the values of the arguments passed in via the
command line. As Charles reminds you, this is similar to the Cin/Cout
functionality in C++.
On Dec 11, 1:32 am, DotnetBeginner <[EMAIL PROTECTED]> wrote:
> I have code like this:
>
> using System;
> using System.Collections.Generic;
> using System.Text;
>
> namespace fundamentalsmethod
> {
> class Test {
>
> public int a, b;
> public Test(int i, int j)
> {
> a = i;
> b = j;
> }
> public int change(int c)
> {
> c = a + b;
> return c;
> }
> }
>
> class Program
> {
> public static void Main(string[] args)
> {
> int val;
> val = int.Parse
> (System.Configuration.ConfigurationManager.AppSettings["MyValue"]);
> Test ob = new Test(12,13);
> ob.change(val);
> Console.WriteLine(ob.change(val));
> }
> }
>
> }
>
> If i want teh sum of 30, 40 i need to change the values every time
> from 12, 13 to 30. 40 what is the best way to avoid this hard code and
> get the sum of any 2 nums.