hello
I am new to C and not sure how to go about getting the following accomplished:
I have the following c code, under centos ver 3.4, using gnu gcc to compile:
uchar sn[8];
// readings
sn[0] = 0x10;
sn[1] = 0x2E;
sn[2] = 0x22;
sn[3] = 0x47;
sn[4] = 0x00;
sn[5] = 0x08;
sn[6] = 0x00;
sn[7] = 0x35;
I want to convert the above array into an Ascii string, is there any simple way of achieving this in C?
ultimately i want to do the following:
query = "Insert into test (reading) values(sn)";
// i want to get it formated as "Insert into test (reading) values ('3500080047222 E10')"
// I understand that c will not insert the value of the array 'sn', unlike php or other glue languages...i am hoping there is some way to achieve this..
do_this_query(q uery);
any help would be appreciated.
I am new to C and not sure how to go about getting the following accomplished:
I have the following c code, under centos ver 3.4, using gnu gcc to compile:
uchar sn[8];
// readings
sn[0] = 0x10;
sn[1] = 0x2E;
sn[2] = 0x22;
sn[3] = 0x47;
sn[4] = 0x00;
sn[5] = 0x08;
sn[6] = 0x00;
sn[7] = 0x35;
I want to convert the above array into an Ascii string, is there any simple way of achieving this in C?
ultimately i want to do the following:
query = "Insert into test (reading) values(sn)";
// i want to get it formated as "Insert into test (reading) values ('3500080047222 E10')"
// I understand that c will not insert the value of the array 'sn', unlike php or other glue languages...i am hoping there is some way to achieve this..
do_this_query(q uery);
any help would be appreciated.
Comment