cant understand error

hi very new to c, trying to teach myself it must be my 100th attempt, anyway could someone please tell me what this error is, its from a you tube tutorial its exactly the same
thank you

#include <stdio.h>



main()
{

    int age;
    int half;


    printf("hello world\n");
    printf("please enter your age: ");
    scanf("%d", &age);
    half = age / 2;
    printf("aperson half your age would be %d\n, half");

    fflush(stdin);
    getchar();
}

the error in my compiler is this,

C:\Users\jons\Desktop\Programming\jons1st\new 2.c|7|multiple definition of `main’|

Place your code in the setup() and loop() functions. The main() function in Arduino Land is buried in the software and for 99.99% of the time should be left as is.

The Arduino environment provides "main" for you invisibly. You only need provide setup and loop

thanks, im using codeblocks as a compiler to learn c im copying examples so i really need to stay in codeblocks

OK, good luck.

Maybe you should be asking on a Code::Blocks forum? This forum is for people programming the Arduino development boards. Your code has nothing to do with Arduino boards, and we don't know how to use Code::Blocks.

yes your probable right i will, thanks just thought someone here would know thanks

Well, even when you got your "main" sorted out, you were going to hit difficulties with printf scanf fflush and getchar

Compiling that code in the Arduino IDE is bound to fail. What Code::Blocks may be providing, or doing, is anyone's guess.

Maybe you have multiple files in your project, each with a main() function in it? Just a guess....

ok panic off its compiled now think there were duplicate files really not sure, think im starting to get c now, thanks

...

main(){
...

It might help if you give a return type, i.e. int or void.

void main(){
}