Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *dbname = valueOfParam("dbname");
- char *dbuser = valueOfParam("dbuser");
- char *dbpass = valueOfParam("dbpass");
- char *conninfo;
- // Then I try compile new variable like this:
- printf("PQconnectdb("dbname=%s host=localhost user=%s password=%s");", dbname, dbuser, dbpass);
- // But I need create the variable
- sprintf(conninfo, "PQconnectdb("dbname=%s host=localhost user=%s password=%s");", dbname, dbuser, dbpass);
- int len = snprintf(NULL,0,......);
- char * buf = malloc(len+1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement