- 1
What is the error in below code? Why can't I convert it to int
int age=0; age=Convert.ToInt32(DateTime.Now-this.dateOfBirth);
2 Réponses
0
public int CalculateAge()
{
int age=0;
age =
Convert.ToInt32(DateTime.Now-this.dateOfBirth);
return age;
}
this.dateOfBirth is a parameter passed to Constructor
- 1
hey amith if you don't mind showing the piece of code at large that might help clear somethings