pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: clarkhorse@clarktx.com
To: Jonah H. Harris <jonah.harris@gmail.com>
To: clarkhorse@clarktx.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Newbie problem with from database in C
Date: Mon, 19 May 2008 06:47:57 +0000
Message-ID: <W7951027752238411211179677@webmail39> (raw)


-----Original Message-----
From: Jonah H. Harris [mailto:jonah.harris@gmail.com]
Sent: Sunday, May 18, 2008 09:52 PM
To: clarkhorse@clarktx.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Newbie problem with from database in C

On Sun, May 18, 2008 at 9:13 PM,  wrote:> characters are fine so far. I have placed the code I am using below.> Would appreciate it if someone could tell me what is wrong or provide me> with a reference on how to do this properly.
 IIRC, you need to convert from network byte order:
idno = ntohl(*((int32 *) PQgetvalue(result, row, 0)));

after adding this code line I get
client3z.c:140: warning: assignment makes pointer from integer without a cast

I also added 
#include <endian.h>

view thread (5+ messages)  latest in thread

Message-ID: <W7951027752238411211179677@webmail39>
Permalink:  ../W7951027752238411211179677@webmail39/
Also on:    postgresql.org/message-id/W7951027752238411211179677@webmail39

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: clarkhorse@clarktx.com, jonah.harris@gmail.com
  Subject: Re: Newbie problem with from database in C
  In-Reply-To: <W7951027752238411211179677@webmail39>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox