My last c++ Project was about 3 years ago and know I have some problems with basics.
I have a class stuff. In my .h file i have a struct:
typedef struct
{
float fX;
float fY;
float fZ;
float fRx;
float fRy;
float fRz;
char aName[14] = "";
} stpoint;
and a private variable stpoint _stpoints[].
In my.cpp I have a function:
void stuff::getstuff()
{
stpoint _stpoints[] = {
{ 164.5, 0.0, 241.0, 90.0, 180.0, -90.0,"Home"},
{ 164.5, 0.0, 141.0, 90.0, 180.0, -90.0,"X1"},
{ 164.5 + 14.7, 35.4, 141.0, 90.0, 180.0, -90.0 ,"X11"},
{ 164.5 + 50.0, 50.0, 141.0, 90.0, 180.0, -90.0,"X12"},
{ 164.5 + 85.3, 35.4, 141.0, 90.0, 180.0, -90.0,"X13"},
{ 164.5 + 100.0, 0.0, 141.0, 90.0, 180.0, -90.0,"X14"},
{ 164.5 + 85.3, -35.4, 141.0, 90.0, 180.0, -90.0,"X15"},
{ 164.5 + 50.0, -50.0, 141.0, 90.0, 180.0, -90.0,"X16"},
{ 164.5 + 14.7, -35.4, 141.0, 90.0, 180.0, -90.0,"X17"},
{ 164.5 + 50.0, 0.0, 141.0, 90.0, 180.0, -90.0,"X18"},
{ 264.5, 0.0, 141.0, 0.0, 90.0, 0.0 ,"X2"},
{ 164.5, 100.0, 141.0, 90.0, 90.0, 0.0,"X3"},
{ 164.5, -100.0, 141.0, 90.0, -90.0, 0.0,"X4"}
};
}
Its a project for Arduino. I use VS2019.
I get error code (just one of them):
stuff.cpp: 37:2: error: could not convert '{1.645e+2, 0.0, 2.41e+2, 9.0e+1, 1.8e+2, -9.0e+1, "Home"}' from '' to 'stuff::stpoint Error compiling project sources Debug build failed for project 'Roboter'
It something about the char array in the struct but i dont get it :(
struct stpoint _stpoints2 = { 164.5, 0.0, 241.0, 90.0, 180.0, -90.0,"Home"}
gives the same error.