• 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: returning value in a function argument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: returning value in a function argument


  • Subject: Re: returning value in a function argument
  • From: Andrew Bowman <email@hidden>
  • Date: Wed, 17 May 2006 17:18:46 -0700


On May 17, 2006, at 5:09 PM, Angelo Chen wrote:

Hi,

How to return NSString in a function argument?
following code does not work:

void getInfo(NSString *info)
{
	info = @"my info";
}

later in the code:

	NSString *info;
	getInfo(info);

but info has nothing




Sounds like you'd be better off using an NSMutableString, check the Cocoa Foundation API. Any particular reason why you can just have getInfo return a new string, and use that?

- Andrew Bowman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: returning value in a function argument
      • From: Angelo Chen <email@hidden>
References: 
 >returning value in a function argument (From: Angelo Chen <email@hidden>)

  • Prev by Date: Core Data fails to retrieve all data
  • Next by Date: Re: taking control of the screen and "locking" onto one window
  • Previous by thread: returning value in a function argument
  • Next by thread: Re: returning value in a function argument
  • Index(es):
    • Date
    • Thread