Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What is the different in these C language?

Status
Not open for further replies.

lcs81

Member level 3
Joined
Aug 2, 2005
Messages
57
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,683
p24fj128ga010.h

I am doing some project using PIC MCU.

But, i find that some discepencies between two program at below.

Program 1:
---------------------------------------------------
#include "p24fj128ga010.h"

int counter;
int main(void)


{counter=1;
TRISA=0;
while(1)
{
PORTA=counter;
counter++;
}


return 0;
}
------------------------------------------------

Program 2:
-------------------------------------------------
#include <16F873.h>
#use delay (clock=4000000)

void main ()
{
char i,j,k;
i=2;
j=3;
k=i+j;
}

--------------------------------------------------

why in program 1 #include continue with "xxxxx.h" and the program 2 is continue with <xxxx.h>. aren't the same?

is both c language right?

they use diffrent compiler?

in program1, the port A is set as output and all output is high. How can we make some of the output of portA is low?
 

p24fj128ga010

lcs81 said:
I am doing some project using PIC MCU.

why in program 1 #include continue with "xxxxx.h" and the program 2 is continue with <xxxx.h>. aren't the same?

Yes they are same, generally <xxxx.h> format is used for standard header files provided by the compiler and standard libraries such as stdio.h, stdlib.h. while "xxxx.h" is used for user's header files.

lcs81 said:
is both c language right?

Yes in most of the cases you can use any format.

lcs81 said:
they use diffrent compiler?

Not necessary, any c compiler will accept both formats.
 

    lcs81

    Points: 2
    Helpful Answer Positive Rating
#include <16f873.h>

in c, only can use hexa and decimal as number? Binary cannot be use?
 

deffirent terms of c language

In general, the

#include <xxx.h>, the C compiler will search the header file in the standard directory i.e, C:\Program Files\SDCC\include if you use SDCC as C compiler. But for

#include "xxx.h" , the C compiler will search the header file in the local directory which is the same direct as xxx.c file or path specific.

In this case

#include <16F873.h> mean that 16F873.h is a standard header file.
#include "p24fj128ga010.h" mean that p24fj128ga010.h may be written by someone else with own work.

--------------------------------------------------------------------------------------
Microcontroller Programming:
https://mcu-programming.blogspot.com
uC - News, Resources and Tutorials
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top