Hi,
I am developing in C on mac OsX.
I recently downloaded the new version of gcc (gcc4-0) and I have a problem of execution on the following code.
It seams that the use of strcpy have action on the memory and modify the value in the lieu variable (variable of the loop)
I tried on other computers with other versions of gcc and it functions well.
Does anyone know about such a problem?
Thank you very much for your help
Julie
I am developing in C on mac OsX.
I recently downloaded the new version of gcc (gcc4-0) and I have a problem of execution on the following code.
It seams that the use of strcpy have action on the memory and modify the value in the lieu variable (variable of the loop)
I tried on other computers with other versions of gcc and it functions well.
Does anyone know about such a problem?
Thank you very much for your help
Julie
Code:
for (lieu=0 ; lieu<nb_lieu ; lieu++)
{
printf("\n lieu %d \n",lieu); // print 0, 1, 2, 3... OK
convert_lieu(lieu,chlieu); // this function does not affect lieu,
// just put in chlieu the adequate value
printf("\n lieu %d \n",lieu); // print 0, 1, 2, 3... OK
/****** HERE ******/
strcpy(ch, "\n Blablabla ");
printf(" %d \n",lieu); // print enormous values
/************/
strcat(ch,chlieu);
}