• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: warning: initialization makes integer from pointer without a cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: initialization makes integer from pointer without a cast


  • Subject: Re: warning: initialization makes integer from pointer without a cast
  • From: "Dave DeLong" <email@hidden>
  • Date: Thu, 21 Aug 2008 07:40:49 -0700

Try putting an * after both uses of "char".

CStrings (char arrays) are char pointers.

Dave

On Thu, Aug 21, 2008 at 6:42 AM, Stuart Green <email@hidden> wrote:
> Hi,
>
> I'm either overlooking something extremely simple here or I'm losing my
> mind.
>
> I have two NSString objects in a NSDictionary object that I am passing to a
> class method in the form:
>
>        (int)validateUsersFor:(NSString *)username withEmailAddress:(NSString
> *)email
>
> Within the function, I need to convert the NSStrings back to C Strings (for
> a C API) so I'm using:
>
>        const char cUserName = [username UTF8String];
>        const char cEmail = [email UTF8String];
>
> However, come the build, I get
>
>        warning: initialization makes integer from pointer without a cast
>
> I thought I was doing everything right.  Any ideas?
>
> Cheers,
>
> Stu
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >warning: initialization makes integer from pointer without a cast (From: Stuart Green <email@hidden>)

  • Prev by Date: CALayer retain count
  • Next by Date: Re: !foo vs foo == nil
  • Previous by thread: warning: initialization makes integer from pointer without a cast
  • Next by thread: Re: warning: initialization makes integer from pointer without a cast
  • Index(es):
    • Date
    • Thread