the question you put on the SDCC news group is quite a C beginners
question. I really don't think that you do yourself a favour if you
start programming C on a microcontroller. If your micrcontroller project
is not completely trivial, i think it might be faster (and better for
your health) if you first spend one week or two weeks to go through a C
tutorial book using a PC C Complier and then start with your
microcontroller project. Learning progress on a PC is usually much
faster, because PC C Compilers have more comfortable debuggers and it is
possible to work through a tutorial book on a PC. Microcontrollers
usually have limitations, so that textbook examples won't compile or run
on Microcontroller boards. I think that you should have programming
experience in C without the limitations of a microcontroller, so that
you know what doesn't work cause of these limitations and what doesn't
work because it is simply wrong.
> -----Original Message-----
> From: sdcc-user-admin@...
> [mailto:sdcc-user-admin@... Behalf Of Daryl
> Sent: Thursday, December 05, 2002 3:32 AM
> To: sdcc-user@...
> Subject: [Sdcc-user] unsigned char to unsigned int warning
> I'm trying to compile a c program that will display a text
> string to an LCD display. I know I have to use a pointer
> which I am doing, but it doesn't work. I get a wierd warning
> that doesn't make sense to me
> lcddisplay.c(41):warning *** indirections to different types
> assignements type --> 'array of const char' assigned to type
> --> 'unsigned int'
> I can still compile the program but it doesn't.
> If I do a simple program for dos that uses pointers, I can
> get it to display the text
> my program declarations are
> void main(void)
> uchar A; //declare an unsigned character varible
> int count;
> unsigned char *ptrA; //declare a pointer
> A="Hello ";
> ptrA=&A; //Pointer ptrA points to the address location of
> the first character of variable A
> The ptrA=&A is line 41. How is this an unsigned int?
> LCDputchar(*ptrA); // Display the letter that
> the pointer ptrA points to
> ptrA=ptrA+1; //increment the address that
> pointer ptrA points to by 1
> void LCDputchar(uchar value)
> int i;
> for(i=0;i<125;i++); //delay
> I can do an equivalent DOS program that works fine.
> Thanks for any help
> This SF.net email is sponsored by: Microsoft Visual Studio.NET
> comprehensive development tool, built to increase your
> productivity. Try a free online hosted session at:
> Sdcc-user mailing list