-
Junior Member
C and C++ in .Net 2005 environment
Hello friends,
Plz can u solve my doubts
1)why C++ language is called as a partial object oriented language.
2)can we do C and C++ programs in .net 2005 environment.if so plz can u tell the procedure for it.ie steps to do.
3)In C,C++ language we can swap two values by using call by value?
In c# by using call by value,can we swap two numbers.the values are swapping for but in the result it is not showing the swapped values.
the pgm which i wrote is
In the form I have taken a button.
In general declaration
class test
{
public void swap(int x, int y)
{
int t = x;
x = y;
y = t;
MessageBox.Show("x = " + x.ToString());
MessageBox.Show("y = " + y.ToString());
}
}
In button_click
{
test t = new test();
int a=10,b=20;
t.swap(a, b);
MessageBox.Show(a.ToString() + " " + b.ToString());
}
plz mail the answers to aru576 @ yahoo . co . in
Thanks and bye
waiting for u r reply.
-
Junior Member
Re: C and C++ in .Net 2005 environment
From ur code, I understand that you are not returning the swaped values back to the calling code. Try to return it back and it will work fine.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules