Please see code
When I print out cust_as_str on the last line
Why in the world would it be blank. The other 3 that I print out are populated
I tryed populating this variable with sprintf and then I used strcpy and cannot get a value in it
This is driving me nuts
Please help
THanks
Carl
Code:
int InsertCCharge (CCharge cc)
{
char cust_as_str[10];
char chid_as_str[10];
memset (cust_as_str, '\0', sizeof(cust_as_str));
memset (chid_as_str, '\0', sizeof(chid_as_str));
/*sprintf (chid_as_str, "%d", cc.cc_ch_id);*/
strcpy (chid_as_str, "sdfd");
sprintf (cust_as_str, "%d", cc.cc_cust);
printf ("IT IS %d\n", cc.cc_ch_id);
printf ("IT IS %s\n", chid_as_str);
printf ("CUST IS %d\n", cc.cc_cust);
printf ("CUST2 IS %s\n", cust_as_str);
return(0);
}
When I print out cust_as_str on the last line
Why in the world would it be blank. The other 3 that I print out are populated
I tryed populating this variable with sprintf and then I used strcpy and cannot get a value in it
This is driving me nuts
Please help
THanks
Carl