Can anyone help me with a C++ question really quick? No one is in the CS section...
what is your q? i am intermediate btw so dont put hopes up.
Its fairly simple, I'm trying to run 20,000 iterations on a program (which I KNOW works); I set it to 10,000 (for the main loop) and it runs just fine. Set it to 15,000, runs perfectly. Set it to 20,000 I get "Run failure(exit value 1; time ____ms)" Do you have any idea how to fix this? :/
i dont know maybe you should use a bigger integer. I mean like long int or something.
But int covers up to 2 billion! I was thinking maybe my CPU can't handle it? but it ends quickly not after a while, no infinite loops or anything...I just don't know
maybe like a some iteration >1500 it has some problem that is not allowed wihtin your loops like division by zero or something lol. Try catching the exact iteration where the loop crashes.
How do I find that? o.o
i think there is a feature where it throws an error message and you can give it exception handling steps. I haven't done it in years so i dont remember lol. What compiler you using? might want to go ino debugging mode too.
I'm using netbeans :/
i never heard of that i use bloodshed, and visual c++ i had sdk once the one from nokia or something.
my dad used to teach c++ at ircc years ago when he wakes up I'm sure he could help you
Please don't post unrelated questions to this group. It would be better for you to post this in a more appropriate group and then post a link to it in any of the chat windows if you find no one available to help out in that group. This helps keep the groups on topic. Please refer to our Code of Conduct if you require further clarification: http://openstudy.com/code-of-conduct
Are you kidding...? No one is in the appropriate group, I've been on here for months and people know me...one unrelated question from me isn't going to shut down openstudy. Thank for you being rude however. :)
And honestly, more people post stupid crap than this legitimate, though offtopic, question.
@myininaya :D
2 best answers for mal :)
did u try seeing physical memory map in task manager, while the program is running... it may give some hint i think
How do I view this on Mac? x.x
no idea on Mac im windows & linux only lol im thinking your program is running outof memory. thats why it is not failing upto 1500... but increasing the iterations is crashing the program.. .not sure
My research advisor is gonna get me access to their supercluster so this shouldn't be an issue since I'll be running it on their comp?
i hope so.. if its not confidential you can pass the code to me.. i have access to good machines i can give a try
I think you might be right actually, I wrote a program to find prime numbers for projecteuler and when I did numbers like 100,000 it worked but if I did the number in question like 6 billion? Even using the long int it just gave me a "run failed"
@malevolence19 this does not belong in the Mathematics group. As such, it should not be posted in the Mathematics group. Next time, please ask the question in the computer science group instead. If there isn't anyone answering your question, be more patient, or post a link in the chat room. Also, in my opinion, asnaseer was very polite in his response, and your response to that seemed very rude in comparison. I'm closing this question now.
/facepalm
Thanks for the help guys :)
np
Join our real-time social learning platform and learn together with your friends!