For some strange reason every time I compile my project I get this strange error of multiple definitions even though this is the only place I define my function. I use code blocks as my IDE and GCC as the compiler. Here is the code:
#include <stdio.h>
#include <test.h>
int checkForSquare(int num){
int squared[10001];
squared[num] = num * num;
for(int i = 0; i <= 10000; i++){
if(squared[i] == num){
return 1;
break;
}
}
return 0;
}
int main(){
for(int x = 0;x <=10000;x++){
if(checkForSquare(x))
printf( "%d" , x );
else
printf("Not Square");
}
return 0;
}