Sorry if its a bit out of place but I’m hoping there is someone here that knows the answer.
I’m writing a .NET Console Application in C# that when the user inputs a credit card number it will output what type the credit card is.
The problem I have is declaring the variable that holds the credit card number and that I don’t know what data type it is? Is it a string, a ulong or do I have to create an array of characters?
In the CS50 course, there was an assignment to build basically the same console application but in C. If I remember correctly, we had to use an unsigned long. Though I guess it works as a strong too.
Well, you need to be looking at specific digits to determine card provider so a string representation will be the easiest.
And If you’ll be doing Luhn calculation, it’s also easier to extract specific digit locations on the card number if it’s a string, rather than a numeric variable.