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

Is this declaration is correct or not

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



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

Is this declaration is correct or not
PostPosted: Fri Nov 16, 2007 12:25 am     Reply with quote

Hi everyone,
i am using ccs compiler version 4.020
I am creating an array of pointers to a const string.for this purpose i declare a pointer and a array of string pointer.
Code:

const char *strings[]={"voltage","current","charge","battery"};
const char *ptr;


i want t know that is this the correct way to declare this or there is something wrong.if all r fine then why error is generate here which is in red color.

const char *strings[]={"voltage","current","charge","battery"};

and error msg is "expecting a declaration".
Plz help me out
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Fri Nov 16, 2007 7:50 am     Reply with quote

I copied your declaration into one of my projects and it compiled ok - using PCWH V4.062. V4.020 is pretty old - try a later version !

Ken
Ttelmah
Guest







PostPosted: Fri Nov 16, 2007 9:37 am     Reply with quote

Yes.
The late 4.03x versions, were the first releases, where most things started to work. The use of pointers to constant strings, certainly did not work in the earlier releases. I'm afraid 4.020, is just too old for this to work.

Best Wishes
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

Is this declaration is correct or not
PostPosted: Mon Nov 19, 2007 12:14 am     Reply with quote

Hi,
thankx Ken Johnson and Ttelmah.
but i am using only that version 4.020.how to initialize this all procedure in this version instead of PCWH V4.062 or 4.03x version.
plz reply me as soon as possible.
Ttelmah
Guest







PostPosted: Mon Nov 19, 2007 3:07 am     Reply with quote

I'm afraid the answer is you can't.
_However_, since you have a demonstrable problem, where the compiler does not do what it was sold to you to do, CCS, will (sometimes), if you moan in a 'pointed' way about this, give you download rights, on a latter compiler version, to fix the problem.
Try...
4.020, was not to my mind a working compiler. There are literally dozens of things that the manual says it should do, which it doesn't (try addressmod for example). Try reading the version 4 thread at the top of this group.

Best Wishes
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