thx for your reply
here is the relevant code:
file1 filling the array:
Code:
int tst_user[5];
int Fill()
{
char variable[] = "";
char * pch;
int i = 0;
printf("Enter desired Data in this style XX-XX-XX-XX-XX-XX : \n");
scanf("%s", &variable); //user input to address of variable
pch = strtok (variable, "- :");
while (pch != NULL)
{
printf("%s \n",pch); //control of splitting
sscanf (pch, "%x", &tst_user[i]); //filling
pch = strtok (NULL, "- :");
printf("array index %d = %#x \n",i, tst_user[i++]); //control array and add 1 to index
}
return 0;
}
.
.
.
Fill()
.
.
.
used header:
Code:
extern int tst_user;
file 2 assigning the array to the pointer:
Code:
pTest->tst[0] = tst_user[0]);
manually(static) assigning works just fine:
Code:
pTest->tst[0] = 0x00;
but this is not what i want.
The code is very long and the failure should be in the assignment or the interchange of the array itself.
i also tried it with:
Code:
pTest->tst[0] = static_cast<int>(tst_user[0]);
which gives the same error.
Thanks for reading/helping
kox