By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

warning assignment makes integer from pointer without a cast.

P: 1
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",destination);

e = (strcmpi(destination,"exit"));
name[i] = destination;
Mar 1 '08 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
I tried to fill in your code this way:
Expand|Select|Wrap|Line Numbers
  1. int main()
  2. {
  3.     char destination[10];
  4.     char name[10];
  5.     int i = 0;
  6.     int e;
  7. scanf("%s",destination);
  8.  
  9. e = (_strcmpi(destination,"exit")); 
  10. name[i] = destination;
  11. }
  12.  
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.
Mar 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.