Hey there,
I'm having a bit of a problem with a C++ program I've been writing and I was hoping you guys might be able to help me. This issue has been really stressing me out as I have no idea what is wrong. Here is where things go wrong:
for(a=0;a<check;a++)
holdtwo[a]=str[a+length];
I'm checking a number to see if it matches another number. But the number I'm matching against is in the middle of another number and can be from 1-7 digits long.
SO. Check makes it so the for loop copies one number from str (which is where the number is contained in) at first, and if it's a match, it returns true. If it doesn't match, check goes up by 1, and then copies two numbers, and then 3, and then 4, and then 5, and so on.
length is a previously declared variable that pushes str forward by a certain number, depending on how far in the number I'm looking for is.
Does that make sense?
Right now I'm just trying to copy one digit from str to holdtwo, but when I do that, I get that digit and a bunch of garbage.
Here is a link to my code, first part which calls functions from second part:
http://pastebin.com/aiSRa4Bv
Second part:
http://pastebin.com/7tnz1Jpi
Any and all help would be greatly appreciated. Thank you.