title: Error when connecting to Postgres database in C - using libpq-fe.h
body: <p>Hey I am trying to connect to a database using postgres</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;libpq-fe.h&gt;
  
  int main(int argc, char* argv[])
  {
  //Start connection
  PGconn* connection = PQconnectdb("host=webcourse.cs.nuim.ie dbname=cs621      sslmode=require user=ggales password=1234");
  
  if (PQstatus(connection) ==CONNECTION_BAD)
  {
  printf("Connection error\n");
  PQfinish(connection);
  return -1; //Execution of the program will stop here
  }
  printf("Connection ok\n");
  //End connection
  PQfinish(connection);
  printf("Disconnected\n");
  
  
  return 0;
  }
  </code></pre>
  
  <p>And I keep getting this compile error:</p>
  
  <pre><code>main.c: In function ‘main’:
  main.c:9:35: warning: missing terminating " character [enabled by default]
  main.c:9:2: error: missing terminating " character
  main.c:10:2: error: ‘dbname’ undeclared (first use in this function)
  main.c:10:2: note: each undeclared identifier is reported only once for each function it      appears in
  main.c:10:9: error: ‘cs621’ undeclared (first use in this function)
  main.c:10:15: error: expected ‘)’ before ‘sslmode’
  main.c:10:56: warning: missing terminating " character [enabled by default]
  main.c:10:15: error: missing terminating " character
  main.c:16:1: error: expected ‘,’ or ‘;’ before ‘}’ token
  main.c:16:1: error: expected declaration or statement at end of input
  </code></pre>
  
  <p>Can anyone see why this is happening?</p>
  
  <p>Thanks.</p>