Re: ESQL/C - Retreiving Char(1)
Posted in 1997
Amita Shrivastava wrote: lo.carrier, :trailo.trailer_no, :trailo.dflag, } } } /* structure variables for trailer delivery */ } typedef struct } { } /* 001*/ int tlkey; /* trucklog key */ } /* 002*/ char carrier [35]; /* carrier */ } /* 003*/ char trailer_no [15]; /* trailer number */ } /* 004*/ char dflag; /* delivered flag */ } /* 005*/ char truck_type; /* truck type */ } /* 006*/ char date_empt [9]; /* date empt */ } /* 007*/ char time_empt [7]; /* time empt */ } /* 008*/ char arr_date [9]; /* arrival date */ } /* 009*/ char arr_time [7]; /* arrival time */ } } TRAILERD; } /* #endif */ } ~ John Wells wrote: Amitra it looks to me like you have truck_type defined as a char with no size. Does this provide any space for the data? I don't think so. I define my char vars with one more byte than is defined in the database. Thus since truck_type is a char(1) in the database, my structure says char truck_type[2]; <=== this provides for the nasty null terminator. cheers :)