Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TwoInts {
- uint32_t int1;
- uint32_t int2;
- };
- CREATE TABLE ints (
- id int,
- field bytea
- );
- char query[100];
- struct TwoInts a = {44, 55};
- sprintf(query, "INSERT INTO ints (id, field) VALUES(0, decode('%08X%08X', 'hex'))", a.int1, a.int2);
- INSERT INTO ints (id, field) VALUES(0, decode('000000210000002C', 'hex'));
- struct TwoInts {
- uint32_t int1;
- uint32_t int2;
- };
- CREATE TABLE ints (
- id int,
- int1 int,
- int2 int
- );
- char query[100];
- struct TwoInts a = {44, 55};
- sprintf(query, "INSERT INTO ints (id, int1, int2) VALUES(0, %d, %d);", int1, int2);
- INSERT INTO ints (id, int1, int2) VALUES(0, 44, 55);
Add Comment
Please, Sign In to add comment