I have a problem that's (probably) very easy to solve, only I'am more a Java programmer and I couldn't find anything like it on the internet.
My problem is that I have to add a variable (int, string, double) to a character array. I know that it is very easy with Java but I din't find any thing for C/C++.
Everything I found created errors.
Example:
I've added the first 4 lines of the methode "setOffset(int arg1)". "msg" is the char array created at the beginning of the methode it's importend that the size of this array is equal to the size of the hardcoded string + the length of arg1, because it is used in the "viWrite(.....)".
The char array won't be changed after it's made.
Expand|Select|Wrap|Line Numbers
- bool Tektronix::setOffset(int arg1){
- char msg[] = "source1:Voltage:Offset " + arg1; //this is the Java way
- status = viWrite(vi, (ViBuf) msg , sizeof(msg), &retCnt);
- if (status < VI_SUCCESS) return false;
- .............
ERROR: 'char []': illegal sizeof operand
Second problem is that it says illegal sizeof opperand, but I expect that error will disapear if I've solved the first.
Thanks for all the support
GreetZ
Spikey