View previous topic :: View next topic |
Author |
Message |
hayee
Joined: 05 Sep 2007 Posts: 252
|
Is this declaration is correct or not |
Posted: Fri Nov 16, 2007 12:25 am |
|
|
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
|
|
Posted: Fri Nov 16, 2007 7:50 am |
|
|
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
|
|
Posted: Fri Nov 16, 2007 9:37 am |
|
|
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
|
Is this declaration is correct or not |
Posted: Mon Nov 19, 2007 12:14 am |
|
|
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
|
|
Posted: Mon Nov 19, 2007 3:07 am |
|
|
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 |
|
|
|