First, remember that the first element of an array in C has index zero. I would suggest for your sanity that you start there. Second, don't forget the null byte terminator on the end of a string. So your code should look like (my changes in
bold😞void func1(...)
{
char string[10]="";
char *pstring = &string[
0];
//or just char *pstring = string;func2(string);
SetCtrlCal(panelHandle, PANEL_StringOut, pstring); //StringOut should be ABBA
}
void func2(char test[10])
// note deleted & // or void func2(char *test) // or void func2(char test[]){
int a=65,b=66,c=66,d=65;
test[
0]=(char)a;
test[
1]=(char)b;
test[
2]=(char)c;
test[
3]=(char)d;
test[4]='\0';
}
Martin.
--
Martin
Certified CVI Developer