warning: passing arg 1 of `atoi' makes pointer from integer without a cast

F

francescomoi

Hi.

I'm trying to compile this piece of source:

-------------------------------------------
int id;
while(row1 = mysql_fetch_row(rs1))
{
id = atoi((int)row1[0]);
 
G

Guillaume

Hi.

I'm trying to compile this piece of source:

-------------------------------------------
int id;
while(row1 = mysql_fetch_row(rs1))
{
id = atoi((int)row1[0]);

atoi() expects a pointer to 'char'. What the heck is the cast to 'int'
for?
 
M

Martin Ambuhl

Hi.

I'm trying to compile this piece of source:

-------------------------------------------
int id;
while(row1 = mysql_fetch_row(rs1))
{
id = atoi((int)row1[0]);

By not using an int as the argument to atoi().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top