Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / May 2005



Tip: Looking for answers? Try searching our database.

normal C Arrays to NSArray

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Jensen - 25 May 2005 07:41 GMT
how do I display a c type array of characters using NSLog()?  do I have
to convert it to an NSArray and if so how would I do this? Thanks
Mike Jensen
Michael Ash - 25 May 2005 09:18 GMT
> how do I display a c type array of characters using NSLog()?  do I have
> to convert it to an NSArray and if so how would I do this? Thanks

With the single addition of the %@ specifier for printing objects, NSLog
takes exactly the same arguments as printf, so you can find out all knids
of things about it by typing "man 3 printf" in the Terminal.

%s will log a null-terminated C string, which is just an array of char
where the end is denoted with a 0. If it's not null-terminated, then you
can use the format specifier %.*s and then pass two arguments, where the
first is the length of the string and the second is the actual string.
Tim Cutts - 26 May 2005 16:19 GMT
>> how do I display a c type array of characters using NSLog()?  do I have
>> to convert it to an NSArray and if so how would I do this? Thanks
>
>With the single addition of the %@ specifier for printing objects, NSLog
>takes exactly the same arguments as printf, so you can find out all knids
>of things about it by typing "man 3 printf" in the Terminal.

I don't have any section 3 manpages at all - where do they all live in
the 10.3 developer tools?

I've got manpages for system calls, but not C library functions.

Tim
David Phillip Oster - 26 May 2005 17:11 GMT
> I don't have any section 3 manpages at all - where do they all live in
> the 10.3 developer tools?

From Terminal, type:

man man.conf

for information on where the manpages live.

Signature

David Phillip Oster

Tim Cutts - 27 May 2005 13:47 GMT
>> I don't have any section 3 manpages at all - where do they all live in
>> the 10.3 developer tools?
[quoted text clipped - 4 lines]
>
>for information on where the manpages live.

13:43:55 tim@deimos:~$ man man.conf
No manual entry for man.conf

There's a manpath.config file, but no manpage for that either.  And I've
done a locate on the entire filesystem, and there just isn't a manpage
for fopen() for example.

Tim
Michael Ash - 27 May 2005 14:54 GMT
>>> I don't have any section 3 manpages at all - where do they all live in
>>> the 10.3 developer tools?
[quoted text clipped - 11 lines]
> done a locate on the entire filesystem, and there just isn't a manpage
> for fopen() for example.

I found some info in this mailing list post:

http://lists.apple.com/archives/darwin-dev/2004/Sep/msg00048.html

The man pages are installed by the BSD.pkg on your main OS X CDs.
Apparently it's possible to extract just the man pages from this package.
The post suggests using /bin/pax, and there's also a tool called Pacifist  
which might do the job.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.