I want to split a 40 digit number and send each digit into an array called digits. ToArray doesn't work because it can't convert from char to int. Neither does Split I think? I'm stumped
edit: These are the instructions: Create a class HugeInteger which uses a 40-element array of digits to store integers as large as 40 digits each. Provide methods Input, ToString, Add and Subtract. For comparing HugeInteger objects, provide the following methods: IsEqualTo, IsNotEqualTo, IsGreaterThan, IsLessThan, IsGreaterThanOrEqualTo and IsLessThanOrEqualTo. Each of these is a method that returns true if the relationship holds between the two HugeInteger objects and returns false if the relationship does not hold. Provide method IsZero. In the Input method, use the string method ToCharArray to convert the input string into an array of characters, then iterate through these characters to create your HugeInteger.
int.Parseorint.TryParseon each character.int[] digits = "12345".Where(char.IsNumber).Select(c => int.Parse(c.ToString())).ToArray();string?int?double?