Hello Sir, thanks for reply. Im just testing what you said and i got thiserror:
Enter Username: apellidoUsername : apellidoGrade : (null)
-----------------------------my code:
double i;
char *reply_string;
reply_string = PQgetvalue(res, 0, 1); i = strtod(reply_string,NULL)/2.0;
Sir, i know that PQgetvalue(res, 0, 1); will return number although it isdeclare in the field varchar. Im already test
int i; (also tried unsigned short int)
reply_string = PQgetvalue(res, 0, 1);i = strtoul(reply_string,NULL, 3)/2.0;
Still i got the same error... Im googling how to convert ascii to integerand i saw another question which confused me:
hereit is
Is there a command that can be used to temporarily convert a string value ina field to integer?
I.E.
SELECT name, employeeidFROM usersWHERE employeeid = bob
In this case employeeid is an integer, and bob is a number but stored as astring. how do you temporarily convert bob
toan integer for the sake ofthe comparison?