CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Pointer Operator

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hello188



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

Pointer Operator
PostPosted: Tue Apr 30, 2013 4:58 pm     Reply with quote

Hi I am trying to convert a firmware written for 8051 with keil C compiler to PIC source code for CCS compiler

here, it seems to use pointer operation
A->B = 0x0000

what does it mean? above expression seems to compile without problem

However,

D->E |=D
doesn't pass the compiler test

How do you break it up into two so that it compiles?

Thank you
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 30, 2013 5:25 pm     Reply with quote

Quote:
D->E |=D
doesn't pass the compiler test

It would be better if you posted the actual line of code and all the data
declarations for it. Or better, post a test program and your compiler
version. Example:
Code:

#include <18F4520.h>
#fuses INTRC_IO, NOWDT, PUT
#use delay(clock=4M)   
#use rs232(baud=9600, UART1, ERRORS)

typedef struct
{
int8 a;
int8 b; 
int8 c;     
}abc_t;


abc_t my_struct = {0,1,2};

void func1(abc_t *s_ptr)
{

s_ptr->a |= 0x55;
}

//============================
void main()
{
printf("%x ", my_struct.a);

func1(&my_struct);

printf("%x ", my_struct.a);

while(1);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group