I have a child class
Code:
class IOLabel : public IOField
{
private:
int len;
char format[11];
public:
IOLabel(int row, int col, int len);
IOLabel(const char *str, int row, int col);
~IOLabel(){}; //Deallocating non members?
void display();
int edit(){
display();
return 0;
}
IOLabel &setFormat(const char *format){
strcpy(this->format,format);
return *this;
}
IOLabel &operator=(const char *data){
strncpy((char*)this->data,data,len); //Correct? Data null terminated
}
IOLabel &operator=(int number){ sprintf((char*)data,format,number);}
IOLabel &operator=(double number){ sprintf((char*)data,format, number); }
};
In my definition for one method I need to call a function written in C in the file cio.h. My professor said to use
Code:
extern "C" #include "cio.h"
but I am unsure how
Code:
void IOLabel::display(){
extern "C"
#include "cio.h"
cio_display((char*)data,Row(),Col(),len);
}
Tried that but it didnt work
Code:
error C2598: linkage specification must be at global scope