0

I got a warning:

assignment makes integer from pointer without a cast.

The line that triggers the warning is:

nev[i][0]="";

The nev variable is a 2 dimension char block(please don't ask why, I don't know).

Thanks in advance guys!

6
  • 3
    If nev is a 2-dimensional array of char, then nev[i][0] is a char. But "" is an array of char, not a char. Commented Dec 20, 2016 at 21:00
  • 1
    nev[i][0]=""; --> nev[i][0]=0; Commented Dec 20, 2016 at 21:01
  • I accidentally closed it with wrong question. Reopened it. Commented Dec 20, 2016 at 21:02
  • Ah, I get it! :) Thanks guys! Commented Dec 20, 2016 at 21:07
  • 1
    "" represents an array of char, yes, but furthermore, like any array it is converted to a pointer to its first element when evaluated. That's where the pointer comes from. Commented Dec 20, 2016 at 21:30

1 Answer 1

1

If nev is a 2-dimensional array of char, then nev[i][0] is a char. But "" is an array of char, not a char. – Barmar

nev[i][0]=""; --> nev[i][0]=0; – BLUEPIXY

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.