function that doesn't care about the type in the paramater??
-
Sorry the subject was hard to summerize. I have created a function that I thought was type independent, meaning that it didn't matter what type of an array was passed to the function. It would just write the data with a comma seperation. I have 2 structure in a class called RFMAccess:
struct TSimHeader
{
char Name[47][21];
char Unit[47][21];
double Min[47];
double Max[47];
int SignalCount;
int SimStatus;}static TSimHeader\_arr\[10\]; struct TSimSignal { double Value\[47\]; double TimeStamp; }static TSimSignal\_arr\[10\];
The data in these structures gets updated 2x a second. I also want to write the data to a file 2x a second so, I created a function that I thought would do this without having to declare the array type. I want to be able to use this later in other projects. Here is my function. I am doing something incorrect here, but just not sure what it is.
ofstream fout ("test.txt");
bool firstTime = true;
int passes = 1;void LogData::writeData(void *data){
int count;
if(firstTime){
fout<<"flight_data,";
for(int i=0; i<RFMAccess::TSimHeader_arr[0].SignalCount; i++){
if(i == 0){
fout<log == true)){
if(i == 0){
fout<<data[i]<Thnaks for the help,
Steven -
Sorry the subject was hard to summerize. I have created a function that I thought was type independent, meaning that it didn't matter what type of an array was passed to the function. It would just write the data with a comma seperation. I have 2 structure in a class called RFMAccess:
struct TSimHeader
{
char Name[47][21];
char Unit[47][21];
double Min[47];
double Max[47];
int SignalCount;
int SimStatus;}static TSimHeader\_arr\[10\]; struct TSimSignal { double Value\[47\]; double TimeStamp; }static TSimSignal\_arr\[10\];
The data in these structures gets updated 2x a second. I also want to write the data to a file 2x a second so, I created a function that I thought would do this without having to declare the array type. I want to be able to use this later in other projects. Here is my function. I am doing something incorrect here, but just not sure what it is.
ofstream fout ("test.txt");
bool firstTime = true;
int passes = 1;void LogData::writeData(void *data){
int count;
if(firstTime){
fout<<"flight_data,";
for(int i=0; i<RFMAccess::TSimHeader_arr[0].SignalCount; i++){
if(i == 0){
fout<log == true)){
if(i == 0){
fout<<data[i]<Thnaks for the help,
StevenWhat is the actual problem your getting? Regards, Brian Dela :-)
-
What is the actual problem your getting? Regards, Brian Dela :-)
It's saying that the type of void is unknown or zero. thanks steven