By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

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

P: n/a
Hi.

I'm trying to compile this piece of source:

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

But I get this warning message:
-------------------------------------
warning: passing arg 1 of `atoi' makes pointer from integer without a
cast
-------------------------------------

How can avoid this message?

Nov 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
fr**********@europe.com wrote:
Hi.

I'm trying to compile this piece of source:

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

But I get this warning message:
-------------------------------------
warning: passing arg 1 of `atoi' makes pointer from integer without a
cast
-------------------------------------

How can avoid this message?


atoi() expects a pointer to 'char'. What the heck is the cast to 'int'
for?
Nov 14 '05 #2

P: n/a
fr**********@europe.com wrote:
Hi.

I'm trying to compile this piece of source:

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

But I get this warning message:
-------------------------------------
warning: passing arg 1 of `atoi' makes pointer from integer without a
cast
-------------------------------------

How can avoid this message?


By not using an int as the argument to atoi().
Nov 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.