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 does &PGRDShadow do in C programming ?

Status
Not open for further replies.

Maya

Junior Member level 1
Joined
Aug 3, 2004
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Barranquilla/Colombia
Activity points
209
C again

Hi, i'm learning to programming in C and i've found this term in one program: &PGRDShadow , and i don't know exactly what it does, is some kind of register or something??? can some body help me?

Thanks :D

The complete instrucction of the program is :

BitWrPortI (PGDR,&PGDRShadow,Led1=led1?0:1,DS1)
 

Re: C again

PGRDShadow is a variable declared somewhere
and &PGRDShadow is the address of such variable

When you call the function BitWrPortI (PGDR,PGDRShadow,Led1=led1?0:1,DS1) <-- without the & operator
then a new copy of the original PGDRShadow i created by the compiler
so the original is never changed .. this is called passing a parameter by value
In order to modify the original variable the REFERENCE has to be passed it means the address .. This is possible with the operator & !
so this is done in BitWrPortI (PGDR,&PGDRShadow,Led1=led1?0:1,DS1)
 

Re: C again

hi

refer Dietel & Dietel ..its a bible for C,C++.

each and every program with all error making possibilities r explained in this book.
if u really want to master C then u must read this book.

all the best
god bless U
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top