• C

what is this error?

when i compile I get this

invalid type argument of `unary *'
 
What is it?
LVL 9
buckeyes33Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tinchosCommented:
Hi buckeyes33,

Place your code and tell us in which line you get that error so we can help you

Tincho
0
buckeyes33Author Commented:
here

   for(i = 0; i <= strlen(bin1)- 1; i ++)
    {
      if(*pbin1[i] != BINNUM1 && *pbin1[i] != BINNUM0)   //this is the line
      {
        j = 1;
      }
    }
0
tinchosCommented:
I'm not sure what's the type of pbin1

but I would say that it must be a char[] or an int[]

in this case

you derreference pbin1 using [] operator

so making pbin1[i] returns a char or an int

and you cannot run operator * to an int or a char


Example

char cV[5];
int  iV[4];

// fill cV and iV

*cV returns a char
cv[1] returns a char
*cv[1] is not valid, as you're applying operator * to a char and you need to apply it to a pointer

*iV returns an int
iv[1] returns an int
*iv[1] is not valid, as you're applying operator * to an int and you need to apply it to a pointer

However, this is just assuming that pbin1 is a char[] or an int[]

If that is the case, then this answer suits you, otherwise, post the definition of pbin1 and I'll be able to help you a little more.

Tincho
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

buckeyes33Author Commented:
it is a char[]   it is a pointer for a variable of for a binary string.

i see that you know your C stuff.  I will increase this question a lot if you can help me out some more(or maybe a lot).  I am having some serous problems with passing information to functions.  My programs has lots of errors due to this and other logical mistakes.   However I am running out of time to get help elsewhere.  If you want to help then i could email you my code and what I am trying to do with it.
0
buckeyes33Author Commented:
just to give you a list of my errors.

project4.c: In function `option1':
project4.c:93: parse error before `;'
project4.c:95: parse error before `;'
project4.c:121: warning: passing arg 1 of `checkforBinary' makes integer from pointer without a cast
project4.c:121: warning: passing arg 2 of `checkforBinary' makes integer from pointer without a cast
project4.c: At top level:
project4.c:123: parse error before `while'
project4.c:126: parse error before `*'
project4.c:126: conflicting types for `addBinary'
project4.c:27: previous declaration of `addBinary'
project4.c:126: warning: data definition has no type or storage class
project4.c:136: parse error before string constant
project4.c:136: warning: data definition has no type or storage class
project4.c:171: conflicting types for `checkforBinary'
project4.c:30: previous declaration of `checkforBinary'
project4.c:219: conflicting types for `addBinary'
project4.c:126: previous declaration of `addBinary'
project4.c: In function `addBinary':
project4.c:231: warning: passing arg 1 of `strlen' makes pointer from integer without a cast
project4.c:234: warning: passing arg 1 of `strlen' makes pointer from integer without a cast
project4.c:237: subscripted value is neither array nor pointer
project4.c:237: subscripted value is neither array nor pointer
project4.c: In function `userOption2':
project4.c:299: warning: passing arg 3 of `convert' makes pointer from integer without a cast
project4.c:303: too few arguments to function `converttobin'
project4.c:305: warning: `return' with a value, in function returning void
project4.c: At top level:
project4.c:331: warning: type mismatch with previous implicit declaration
project4.c:297: warning: previous implicit declaration of `getBinary2'
project4.c:331: warning: `getBinary2' was previously implicitly declared to return `int'
project4.c:412: conflicting types for `convert'
project4.c:28: previous declaration of `convert'
project4.c:457: conflicting types for `converttobin'
project4.c:29: previous declaration of `converttobin'
project4.c: In function `converttobin':
project4.c:459: `bin' undeclared (first use in this function)
project4.c:459: (Each undeclared identifier is reported only once
project4.c:459: for each function it appears in.)


i can't post the code here due to copy cats.
0
tinchosCommented:
buckeyes33,

Sorry but all help must go through some thread here, so that all other experts can also help

However, please either close this question if your question was answered and post another one with your other problems

You'll see that you'll get help from all of us

Glad it helped.

Tincho
0
buckeyes33Author Commented:
I just can't put the code in the threads.  This is b/c they run our programs through a program to test for similarity and I can't afford to have someone take my just.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.