this program (i.e sum_remainder) computes the sum of remainders of each element of src[i]. this way:
- sum += src[i] % divisor
this program doesn't have any error/warning based on the debugger (F5, using visual studio), but when I debug line by line by setting a breakpoint it starts automatically from "return 0" in the main. It's like the function doesn't exist in memory, in fact, I've checked in the disassembly, and function doesn't exist, when I try to set a breakpoint in the first line of sum_remainder function (i.e the function definition) I read this error message (note: this error message isn't listed in the error list):
the breakpoint will not currently be hit. no executable code of the debugger's target code type is associated with this line. possible causes include: "conditional compilation, or the target architecture of this line is not supported by the current debugger code type"
int sum_remainder(int* src, int length, int* dst, int divisor) { int sum = 0; for (int i = 0; i < length; i++) { dst[i] = src[i] % divisor; sum += dst[i]; } return sum; } int main(void) { int src[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int dst[10] = { 0 }; int ret = sum_remainder(src, 10, dst, -2); return 0; }