-4

Hello im having an issue when using the % operator in my class method functions.The console window pop ups but then another window opens when saying " ".exe has encountered a problem and needs to close. any idea? Heres the line of code of when i omit works fine.

r = gnumer % gden;
user954004
  • 101
  • 1
  • 6

2 Answers2

2

Is gden zero? Modulus by zero is just as bad as dividing by zero.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
0

It may because gden ==0, or if gden is not a global or static variable, did you forget to initialize it?

wangshuaijie
  • 1,821
  • 3
  • 21
  • 37