I have programmed for a lifetime, but I only started using C when I came across the Arduino. When I need to advance my knowledge of Arduino programming I go look up the C or C++ construct I need, and get it working. So I have reached a point where I would like to define a data type, so that I may pass that type into a function, and define the function result and the same type.
But here's whats happening. In the following code, the Arduino compiler is completely happy with my typedef, my decalartions, and my operations until I attempt to create the function "concat"at the bottom. Then it tells me that "FString does not define a type." Is this a shortcoming of the Arduino variant of C, and if not, what does it take to get this type recognizable? Do I have to pass references by pointer, or what?
Thanks in advance for any help with this.
John Doner
typedef char FString[30];
FString s1, s2;
void setup()
{
s1[0] = 'a';
s1[1] = 'b';
s2[0] = 'c';
s2[1] = 'd';
}
void loop()
{
s1[0] = s2[1];
s2[0] = s1[1];
}
FString concat()
{
}