Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
C18 is also void main ( )
{
}
But I thought C18 code was compatible with XC8?? So is this no longer true?
just checked the XC16 program I currently have loaded, that goes:
int main(int argc, char** argv) {}
Actually I thought XC8 was the same........But i might have been looking at XC16, I dont remember. I would change but XC 8 has no libs in it and the program for setting up dosnt support many of the chips I use (like 18f4685). or the 18f1330.I don't think it ever was?, but differences are probably small, so it's worth making the effort instead of sticking with a long obsolete compiler.
I just checked the XC16 program I currently have loaded, that goes:
int main(int argc, char** argv) {}
Isnt all this just because they tried to make it more ANSI?And here's another.... When could you possibly pass parameters to main when using a pic...
Hitec was always low level... I actually prefer it that way...I wish they had left HITECH alone and the IDE Hi Tech had! They seem to have mashed the compiler up. The docs are total rubbish for it, and unless your using the Kseries the thing for setting peripherals is useless. Writing your own libs is ok, but it shouldnt be that way. Why start making life harder?
All that is just definitions written to the header file.... Its just like including the types.h some use it, others don't..Seems odd they dont follow the blank C file convention that MPLAB X uses with XC8!
I always do it manually anyway, so I never know when it doesn't workAnd why cant I insert code into the post here?? I went to insert and chose code, but nowt happens!
#include <xc.h>
void main(void)
{
PORTA = 0x00;
RA0 = 1;
PORTAbits.RA2 = 1;
}
Hello everyone
I have seen many programs both int main() and void main() are used as the starting point of a program. I am just confused of when to use int main() and void main(). please someone explain me
Code:int main ( ) { }
Code:void main( ) { }
But!!!! C has to be ANSI standard, so it has to comply even if it doesn't need to...eah but this is a compiler built for a micro controller.............