• 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
Stuffing a NSMutableString with formatted C text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stuffing a NSMutableString with formatted C text


  • Subject: Stuffing a NSMutableString with formatted C text
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Tue, 8 Mar 2005 10:37:19 -0800

Greetings:
I'm trying to incorporate some C code into Objective-C.

The following is a snippet of what I'm trying to harvest:

printf(".11s: %.*s\n", dbf->field_name,
dbf->field_length, value);

The output is 'standard output'. I need the output to go to a <string/char *> variable, preferably NSString or NSMutableString; NOT to a file or screen.

I can't find the appropriate C routine to merely direct it to a char * output (vs the screen/file) so I can read it into a NSString variable.

In short, I need to redirect the above logic to a variable that I can manipulate with Obj-C; not just to a file, or screen.

There must be a simple way to do this.

Any ideas?

Thanks,
Ric.

 _______________________________________________
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: Stuffing a NSMutableString with formatted C text
      • From: Pontus Ilbring <email@hidden>
  • Prev by Date: Re: Fixed pitch font - glyphs sometimes drawn fixed, sometimes variable
  • Next by Date: Re: Stuffing a NSMutableString with formatted C text
  • Previous by thread: Re: Fixed pitch font - glyphs sometimes drawn fixed, sometimes variable
  • Next by thread: Re: Stuffing a NSMutableString with formatted C text
  • Index(es):
    • Date
    • Thread