The function I'm having problems with is called DthDigitofX.
Problems mean nothing to me. Describe exactly WHAT is the problem?
iamthwee
Posting Genius
6,378 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 489
Skill Endorsements: 35
Well just concentrate on this first.
Create one function which spits out all the numbers, 3 ,5,1
put a load of couts and see what you come up with.
(You may want to consider dividing by multiples of ten as well as using the modulus operator as a hint)
Also phorce makes a point boolean is not a datatype I think bool is though. But concentrate on the above.
iamthwee
Posting Genius
6,378 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 489
Skill Endorsements: 35
Correct me if I'm wrong but this should seperate them correctly?
Check it with a few examples? Do most of them work, if so you've answered your question. The loop looks a little dubious though, as long as d <=10, I wonder if the integer you passed in was more than ten digits what would happen? OK you can't declare ints that big but best to make your code extra safe.
I think my problem is more how to pass the individual numbers from function to function than how to seperate them
If this is the case then try writing the program without functions. People tend to see the logic much clearer so they know exactly where they're going wrong and what the function must do and where they must place it.
iamthwee
Posting Genius
6,378 posts since Aug 2005
Reputation Points: 1,567
Solved Threads: 489
Skill Endorsements: 35