I have this code here but it doesn't seem to work;

int answer1[10];
int answer3[10];
char answer2[11];
char answer4[11];
answer1[i1]= answer2[i2] - '0';
answer3[i3]= answer4[i4] - '0';

answer2 and 4 are numbers except in charactor state. answer1 and 3 doesn't equall to answer2 and 4;

Can some one help;

Recommended Answers

All 2 Replies

What's i? Post the full code.

My money's on the fact that your arrays are of different size (you're probably walking off the end of answer1 and answer3). This is impossible to tell without more context. Also, I wasn't sure you needed help from your thread title.

(meaning, we get the idea, and you're less likely to receive help when you do such things)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.