My problem is that it does not compile, simply put. Is that so hard to follow?I still have no dea what you are trying to accomplish and what is the issue.
Rich (BB code):#include <htc.h> // for PIC16F59 const char* Strings[]={"a1","bb22","ccc333"}; // define "jagged" array char Buffer[10]; void FillBuffer(char* Dest,const char* Source); main(void) { FillBuffer(Buffer, Strings[0]); FillBuffer(Buffer, Strings[1]); FillBuffer(Buffer, Strings[2]); } void FillBuffer(char* Dest, const char* Source) { while ( (*Dest++ = *Source++) != 0); }
Rich (BB code):
#include <htc.h> // for PIC16F59
const char* Strings[]={"a1","bb22","ccc333"}; // define "jagged" array
char Buffer[10];
void FillBuffer(char* Dest,const char* Source);
main(void)
{
FillBuffer(Buffer, Strings[0]);
FillBuffer(Buffer, Strings[1]);
FillBuffer(Buffer, Strings[2]);
}
void FillBuffer(char* Dest, const char* Source)
{
while ( (*Dest++ = *Source++) != 0);
}
The first element also is a char*, right? The same in C as array, or almost.
However, I explicitely have to use the & operator (address operator). At least on the baseline.
I have no means to re-install older versions of MPLAB, different compiler, and see if eventually it can work using the older software.