View previous topic :: View next topic |
Author |
Message |
huma
Joined: 23 Jun 2006 Posts: 12
|
Classes/ Structs in CCS C |
Posted: Tue Nov 07, 2006 12:28 pm |
|
|
Hello ,
i want to implement shortest path algorithm for my robot navigation in Pic16F877.
i tried this simnple one but it give error.
y it is so,are classes /structs suppoeted or not?
Code: |
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
struct node
{
int value;
};
void main()
{
node n; //expecting a variaable here???
while(true)
{
output_d(0x00);
}
}
|
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Nov 07, 2006 12:50 pm |
|
|
If you're going to use that method of declaring a structure, then you
need to put the 'struct' keyword in front of the structure tag, as shown
in bold below:
Quote: | void main()
{
struct node n;
|
Also there are no classes in C. The CCS compiler is C, not C++.
Ideally, you should learn these things outside of this forum. |
|
|
huma
Joined: 23 Jun 2006 Posts: 12
|
|
Posted: Wed Nov 08, 2006 7:00 am |
|
|
ok.i ll take care next time.
thanks |
|
|
|