Passing a char variable to a function



i have function receives char , displays on lcd screen. start of function :
code: [select]
void lcd_2(char lcddata[],int spos){

in loop, call :
code: [select]
lcd_2("home", 0);

the above solution working, want replace "home" (hard coded text) variable.

i have tried, in pre-setup :
code: [select]
char lcd2ah[];

and in loop code :
code: [select]
lcd2ah[] = "home";

but not compiling. going wrong ?

quote
but not compiling.


what errors getting?

code: [select]
char lcd2ah[];

what size array create?


Arduino Forum > Using Arduino > Programming Questions > Passing a char variable to a function


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial