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

Classes/ Structs in CCS C

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



Joined: 23 Jun 2006
Posts: 12

View user's profile Send private message

Classes/ Structs in CCS C
PostPosted: Tue Nov 07, 2006 12:28 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Nov 07, 2006 12:50 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 08, 2006 7:00 am     Reply with quote

ok.i ll take care next time.
thanks
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