I'm new to C++ and I'd like to do simple stuff such as writting to disk the content of a char[]
I'm having hard times doing it.
Here's my code:
char x[256],y[256],z[256];
sprintf( x, "%.2f", pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.x ); //pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.x is a float struct
sprintf( y, "%.2f", pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.y ); //pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.y is a float struct
sprintf( z, "%.2f", pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.z ); //pCommandHandling->m_dtHandleInformation[i].Xfrms.translation.z is a float struct
FILE *tracker_file = fopen("NDI_FiMe.TMP","w");
char buffer[] = {x,";",y,";",z};
fwrite(buffer , sizeof(char), sizeof(buffer), tracker_file);
fclose(tracker_file);
The problem I'm having is that I get:
IntelliSense: a value of type "char *" cannot be used to initialize an entity of type "char"