cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
File.exe has stopped working...
File.exe has stopped working...
Aug 23, 2014 at 3:04pm UTC
RealGiganitris
(359)
When x == 14, the program crashes. why?
Assume x == 14:
1
2
3
4
5
6
...
if
(x>=14) { a = x -14; a = rand() %a +5; b = rand() %2; ...
Aug 23, 2014 at 6:25pm UTC
Ganado
(6777)
You're trying to divide by zero at a = rand()%a, because a is assigned 0 (14 - 14) at line 3. (This isn't windows related btw)
Last edited on
Aug 23, 2014 at 6:27pm UTC
Aug 25, 2014 at 8:28am UTC
RealGiganitris
(359)
Oops, I assumed because of the windows OS and all...
Topic archived. No new replies allowed.