![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Dave Hills Guest
|
"byte" data type |
Posted: Sun Mar 30, 2003 1:58 pm |
|
|
I am presently evaluating CCS PCW for use in a project. I am having difficulty finding a documentation reference to the following statements:
byte k=5;
byte const weeks=52;
I assume that the first declares a byte of memory labeled "k" a value of 5, and the second declares a constant labeled "weeks" a value of 52. My problem is I can't find any reference to "byte" as a data type in the compiler documentation.
Also, the following code generates an error [38]:
typedef int byte;
This is verbatum from the mauual, (page 53), but when I compile it, I get an error "expecting identifier" with a marker between the "e" and ";" at the word byte. Again, I have been unable to find areference in the docs.
___________________________
This message was ported from CCS's old forum
Original Post ID: 13239 |
|
![](templates/subSilver/images/spacer.gif) |
R.J.Hamlett Guest
|
Re: "byte" data type |
Posted: Sun Mar 30, 2003 2:34 pm |
|
|
:=I am presently evaluating CCS PCW for use in a project. I am having difficulty finding a documentation reference to the following statements:
:=
:= byte k=5;
:= byte const weeks=52;
:=
:=I assume that the first declares a byte of memory labeled "k" a value of 5, and the second declares a constant labeled "weeks" a value of 52. My problem is I can't find any reference to "byte" as a data type in the compiler documentation.
:=
:=
:=Also, the following code generates an error [38]:
:=
:= typedef int byte;
:=
:=This is verbatum from the mauual, (page 53), but when I compile it, I get an error "expecting identifier" with a marker between the "e" and ";" at the word byte. Again, I have been unable to find areference in the docs.
Byte does not exist as a default type in CCS C. However it is defined using a #define, in all the include files for the different processors.
Generally, the include file for the processor you intend to use, forms an essential part of the documentation in this C, since it includes definitions like this, and also the values used by several of the functions.
Now in your final line (the typedef), 'byte', since it is a define, not a typedef, will get expanded by the compiler into the word 'int', and the line becomes:
typedef int int;
Which syntactically causes a recursion, and will give problems...
Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 13240 |
|
![](templates/subSilver/images/spacer.gif) |
Dave Hills Guest
|
Re: "byte" data type |
Posted: Sun Mar 30, 2003 3:19 pm |
|
|
Yes, Thank You!
A quick look at the device header file makes this all quite clear.
Thanks Again!!
___________________________
This message was ported from CCS's old forum
Original Post ID: 13242 |
|
![](templates/subSilver/images/spacer.gif) |
R.J.Hamlett Guest
|
Re: "byte" data type |
Posted: Mon Mar 31, 2003 2:03 am |
|
|
:=
:=
:=Yes, Thank You!
:=
:=A quick look at the device header file makes this all quite clear.
:=
:=Thanks Again!!
I think the CCS manual, should really have a 'leader' page, saying that you should have print out/use the header file in conjunction with it. Unfortunately, this is not given, and so this sort of problem is common...
Good Luck.
___________________________
This message was ported from CCS's old forum
Original Post ID: 13244 |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|