I am using Code Blocks version 12.11, when i run any code in code blocks IDE it shows the following message, so please help what is wrong my code blocks
-------------- Build: Debug in ProjectOne (compiler: GNU GCC Compiler)---------------
ar.exe -o bin\Debug\ProjectOne.exe obj\Debug\main.o
ar.exe: no operation specified
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
#include <stdio.h>
#define N 40
void sum(int*p, int n, int d[])
{
int i;
*p = 0;
for(i = 0; i < n; ++i)
*p = *p + d[i];
}
int main()
{
int i;
int accum = 0;
int data[N];
for(i = 0; i < N; ++i)
data[i] = i;
sum(&accum, N, data);
printf("sum is %d\n", accum);
return 0;
}
Possibly, your program exits too fast.
In this case you should pause your program when your program ends. To do this you'll only need to include <conio.h> then add getch(); at the end of your function main(), before the code return 0;.
Edit :
@mutexe - I see it says "sum is 780", not 700 as you mentioned above
... maybe it would make sense to look what the "physical" output of the build-process is, i.e. if there are object files in the respective folders etc. and exe (i bet not) or anything can be found.