i have an alternative solution for you but sneaky, try the code below:
string s = "1234";
int input;
foreach (char c in s)
{
Console.WriteLine(c)
}
you see that by the means of this solution you don't need conversion but be carefull if you want do arithmatic operation on c...
the problem is that Int32.Parse() method only accepts String as its parameter. so you should convert Char to String before calling this method. Try the code below:
String myString = "1234";
int input;
char c;
for (int i = 0; i < myString.Length; i++)
{...
because the relationship between A and B is "IS_A_RELATIONSHIP", you can use implicit casting:
B b = new B();
A a = new A();
// codes here to initialize b parameters and proberties
a = b; // you also use a = (a)b;
// codes here to initialize other params of a
Touraj Ebrahimi
you can also use string.format() function, for instanse consider the below example:
Decimal x = 12.3456;
string s = String.Format("{0:F2}",x);
console.WriteLine(s); // will output 12.34
F2 is a control: the number after 'F' indicates the number of digits after decimal point.
Touraj Ebrahimi
using ref is okey but if you have not initialized variables before passing them to the function you should use out instead.any way using ref and out both are used to call a function using call by refernce method in c#.
Touraj Ebrahimi
decimal m1; // good
decimal m2 = 100; // better
decimal m3 = 100M; // best
The declaration of m1 allocates a variable m1 without initializing it to anything.
Until you assign it a value, the contents of m1 are indeterminate. But that’s
okay, because C# doesn’t let you use m1 for anything...
How i can create account(username/ pass) for users in a FTP server on sun sloaris 8 in a way that only the user can access to a specific folder and its subfolders not root and other folders?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.