C++ Help

Help..
The problem is commented there in lines ..
If you don't understand, warn me and I'll try to explain better.
(I'm not good in english, i'm sorry)

https://pastee.org/8252k (pass lucas123)

I'll be greatful
Last edited on
1st - don't put code in external websites. Whoever comes here later won't be able to benefit from the info in this thread if the code is not available.

2nd - GOTOs are EVIL! never use them! :P

In your code:
1
2
char* szp1 = 0, *szp2 = 0, *szp3 = 0, *szp4 = 0;
char* szr1 = 0, *szr2 = 0, *szr3 = 0, *szr4 = 0;

...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if (xp == 1) // Here.. I don't want add by 1 for 1, I want add by a LOOP according with my struct pQuiz
{
	szp1 = pQuiz->szPergunta;
	szr1 = pQuiz->szResposta;
}
	if (xp == 2)
{
	szp2 = pQuiz->szPergunta;
	szr2 = pQuiz->szResposta;
}
	if (xp == 3)
{
	szp3 = pQuiz->szPergunta;
	szr3 = pQuiz->szResposta;
}


What I would do is to put those variables in an array or vector, and then just loop over the vector
Last edited on
Thanks fixed.
Topic archived. No new replies allowed.