473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
2 14254
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Markus Dehmann | last post by:
The following if condition if((stream = fmemopen((void*)str, strlen(str), "r")) == NULL){ // ... } gives me a warning: assignment makes pointer from integer without a cast But only when I...
16
by: jose_luis_fdez_diaz_news | last post by:
Hi, If I don't include <libgen.h> I get then warnig below in regcmp call: warning: improper pointer/integer combination: op "=" but if I include it the warning is not shown, but them program...
5
by: Lee Xuzhang | last post by:
/* from SICP -- Exercise 4.21: ((lambda (n) ((lambda (fact) (fact fact n)) (lambda (ft k) (if (= k 1) 1 (* k (ft ft (- k 1))))))) 10) */
3
by: mrmattborja | last post by:
Hello, Here is a program I'm playing around with for fun in the process of learning C. The objective is to create a function filesize() and call it from within the main() section to retrieve the...
6
by: Kinbote | last post by:
Hi, I'm trying to make a function that opens a file, reads it in line by line, puts each line into an malloc'd array, and returns the array. I suspect I'm going about it in an atypical fashion, as...
10
drhowarddrfine
by: drhowarddrfine | last post by:
warning: assignment makes pointer from integer without a cast I get that when I compile a C file where the function is defined as this: char **getvars() and the calling function has this...
1
by: dn6326 | last post by:
Hi there, im pretty new to this forum and would be grateful of some help. I've only started programming this year and am pretty lazy with it so please bare with me if im acting like a bit of a...
2
by: jthep | last post by:
I'm creating an addrecord and a delete record for a linked list below: int addRecord(struct record **start, char name, char address, int yearofbirth, char telno) { struct record *temp; ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.