I have a array called Table1 witch contains '1','2','3','4' I do not want to work with global variables I want to change the content of Table1 with a function called 'Change' that gives a return char array back in to Table1
This is the program i wrote:
void setup()
{
Serial.begin(9600);
}
void loop()
{
char tabel1[4] = {'1','2','3','4'};
int i;
for (i = 0; i <= 3; i++)
{
Serial.println(tabel1[i]);
}
tabel1 = Change(tabel1);
for (i = 0; i <= 3; i++)
{
Serial.println(tabel1[i]);
}
}
char Change(char tabel2)
{
tabel2[0] = 'n';
tabel2[1] = 'b';
return tabel2;
}
This is the error i'm getting:
In function 'void loop()':
testArray:17: error: incompatible types in assignment of 'char' to 'char [4]'
tabel1=Change(tabel1);
^
In function 'char Change(char*)':
30:12: warning: invalid conversion from 'char*' to 'char' [-fpermissive]
return tabel2;
^
exit status 1
[Error] Exit with code=1
table
ortabel
??