C problems validating a credit card
A pointer to a char is not the same thing as a std::string. I used "card Number.length();" What should I do if I wish to convert a string to an integer array ??? or do I have to convert it using my own function ??Sometimes when you make this mistake, the compiler will be able to work out how to convert what you're passing the function into what the function expects. You can read something about log10 or just play a little around.It returns a floating point number which is close to the number of digits.
It could be very difficult to give you good hints, because of your restrictions.
If it expects some custom class, passing it a pointer to a float just will not work.
In this case, the function expects a pointer to a character, so passing it a std::string just will not work.
If the included checksum matches the calculated checksum, then the number is valid.
Your second error is exactly the same; you're trying to feed a parameter of type char to the atoi function, but the atoi function does not take a char. A function will have a set of parameters it accepts, and it will accept no others.
• Determine the sum of the undoubled digits from the products (Step 1) and each of the unaffected (odd-positioned) digits in the original number.