Link to home
Start Free TrialLog in
Avatar of buckeyes33
buckeyes33

asked on

I get this compiler error message

what does this mean:

warning: passing arg 1 of `strlen' makes pointer from integer without a cast
Avatar of Gratch06
Gratch06

you're probably calling a function such as:

function1(int* intVar);

with the function call:

function1(strlen(....));

In which case, the strlen funtion returns an integer, but your funtion wants a pointer to a value (integer or otherwise).  C will not dereference and convert this to a pointer, but will take the value as is and use it as a pointer, a flaw which can prove fatal to your program.
Avatar of buckeyes33

ASKER

the lines the the compiler are telling me tis the problem are for for loops

here is an example

 for(i = 0; i <= strlen(*pbin1)- 1; i ++)
    {
      if(*pbin1[i] != BINNUM1 && *pbin1[i] != BINNUM0)
      {
        j = 1;
      }
    }
The problem is that I can not use a pointer to determine the string length.  
Hi buckeyes33,

What's the declaration for pbin1

Amit
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sys_prog
I figured it out and ask CS to delete question they just have not yet.
I just decided that since Sunnycoder got the correct answer that I will accept his question.  I did not state how I figured it out where as he did.