Click here to Skip to main content
16,011,578 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Existing Project including problem Pin
jhwurmbach11-Oct-07 21:54
jhwurmbach11-Oct-07 21:54 
GeneralRe: Existing Project including problem Pin
ashishbhatt11-Oct-07 22:06
ashishbhatt11-Oct-07 22:06 
QuestionClistBox owner draw not display Pin
s196675m11-Oct-07 18:47
s196675m11-Oct-07 18:47 
QuestionHow to lay some Text Edit Controls in a Scroll View Pin
today4220011-Oct-07 16:27
today4220011-Oct-07 16:27 
AnswerRe: How to lay some Text Edit Controls in a Scroll View Pin
Karismatic11-Oct-07 19:25
Karismatic11-Oct-07 19:25 
QuestionVector Assertion Failure. Pin
Michael10111-Oct-07 13:37
Michael10111-Oct-07 13:37 
AnswerRe: Vector Assertion Failure. Pin
User 58385211-Oct-07 17:38
User 58385211-Oct-07 17:38 
GeneralRe: Vector Assertion Failure. Pin
Michael10111-Oct-07 17:55
Michael10111-Oct-07 17:55 
My code is calculating numbers together in the vector and based on certain conditions it must build another element in the vector to keep the equation going. If not, eventually the number will be too big for longs, int, short e.t.c....

When it creates a new element it always returns to that for loop code and it the iterator is always equal to -274 which is just wrong. It should be one more to what it left off as.

The code is posted below, it's a complex equation but it might help.

for (Iter = PrimeNumber.begin(); Iter != PrimeNumber.end(); Iter++)
{
//*Iter = PrimeNumber[y];
*(Iter) += *Iter;

if (*Iter > 9)
{
PrimeNumber[0] -= 10;
for (Iter1 = PrimeNumber.begin(); Iter1 != PrimeNumber.end(); Iter1++)
{
Counter++;
if (Counter = PrimeNumber.size() - 1)
*(Iter + 1) += (*(Iter + 1)) + 1;
else
PrimeNumber.push_back(1);

if (PrimeNumber[Counter] > 9)
{
if (Counter < PrimeNumber.size())
{
PrimeNumber[Counter] -= 10;
PrimeNumber[Counter + 1] += 1;
}
else
PrimeNumber.push_back(1);
}
break;
}
Counter = 0;
}

Ultimately, this code increaments numbers into the vector and if the number is 16 in the vector is displays as [6][1] (Computers write backwards of course). It's when it makes the new element for the 1 it goes nuts on the Iterator.

Thanks for your interest, I appreciate the help!

Michael Smile | :)
GeneralRe: Vector Assertion Failure. Pin
User 58385211-Oct-07 18:13
User 58385211-Oct-07 18:13 
GeneralRe: Vector Assertion Failure. Pin
Michael10111-Oct-07 18:22
Michael10111-Oct-07 18:22 
GeneralRe: Vector Assertion Failure. Pin
Michael10111-Oct-07 18:29
Michael10111-Oct-07 18:29 
GeneralRe: Vector Assertion Failure. Pin
User 58385211-Oct-07 18:29
User 58385211-Oct-07 18:29 
GeneralRe: Vector Assertion Failure. Pin
Michael10111-Oct-07 18:42
Michael10111-Oct-07 18:42 
AnswerRe: Vector Assertion Failure. Pin
jhwurmbach11-Oct-07 21:51
jhwurmbach11-Oct-07 21:51 
QuestionRe: Vector Assertion Failure. Pin
David Crow12-Oct-07 2:46
David Crow12-Oct-07 2:46 
Questionconvert double to unsigned short Pin
l_d11-Oct-07 9:43
l_d11-Oct-07 9:43 
AnswerRe: convert double to unsigned short Pin
led mike11-Oct-07 10:12
led mike11-Oct-07 10:12 
JokeRe: convert double to unsigned short Pin
Mark Salsbery11-Oct-07 13:21
Mark Salsbery11-Oct-07 13:21 
AnswerRe: convert double to unsigned short Pin
Stephen Hewitt11-Oct-07 17:50
Stephen Hewitt11-Oct-07 17:50 
AnswerRe: convert double to unsigned short Pin
Nelek11-Oct-07 20:01
protectorNelek11-Oct-07 20:01 
GeneralRe: convert double to unsigned short Pin
led mike12-Oct-07 4:48
led mike12-Oct-07 4:48 
GeneralRe: convert double to unsigned short Pin
Nelek29-Oct-07 22:11
protectorNelek29-Oct-07 22:11 
QuestionFill Data in Active Window Pin
vikrant kpr11-Oct-07 9:21
vikrant kpr11-Oct-07 9:21 
QuestionImage enhancment Pin
Deepu Antony11-Oct-07 9:05
Deepu Antony11-Oct-07 9:05 
AnswerRe: Image enhancment Pin
led mike11-Oct-07 9:42
led mike11-Oct-07 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.