warning assignment makes integer from pointer without a cast.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • woods1313drew
    New Member
    • Mar 2008
    • 1

    warning assignment makes integer from pointer without a cast.

    The following code in c+ gives me the warning assignment makes integer from pointer without a cast.
    destination is set as char destination[10] to limit the input string to 10 characters.
    name[i] is an array of ten places char name[10]
    iv looked in several books but cant find an references to integer pointer errors.
    Could someone tell me what i am doing wrong thanks.

    scanf("%s",dest ination);

    e = (strcmpi(destin ation,"exit"));
    name[i] = destination;
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    I tried to fill in your code this way:
    [code=c]
    int main()
    {
    char destination[10];
    char name[10];
    int i = 0;
    int e;
    scanf("%s",dest ination);

    e = (_strcmpi(desti nation,"exit")) ;
    name[i] = destination;
    }
    [/code]

    but failed to get it to compile much less get a warning.

    I used the POSIX _strcmpi since strcmpi is deprecated.

    Maybe you could provide code that produces your warning.

    Comment

    Working...