Re: where are the results of calls to printf, fprintf shown?
Re: where are the results of calls to printf, fprintf shown?
- Subject: Re: where are the results of calls to printf, fprintf shown?
- From: Boyd Collier <email@hidden>
- Date: Wed, 28 Dec 2011 21:34:41 -0800
Joar et al.
I finally figured it out, and (as usual), it's rather simple. One must check Show debugger with Console View in Xcode preferences Behaviors. What confused me is that I presumed that I could simply look at all of the messages in the Console window and see the results of printf, just as I can see the results of a call to NSLog.
Thanks for responding to my query.
Boyd
On Dec 28, 2011, at 8:24 PM, Joar Wingfors wrote:
> Hi Boyd,
>
> The code that you provided works just fine on my machine (I get output from all three calls in the console). I'm also using Mac OS X 10.7.2 and Xcode 4.2.1.
>
> Joar
>
>
> On 28 dec 2011, at 11:52, Boyd Collier wrote:
>
>> How does one use printf and its friends in Xcode 4.2?
>>
>> Here is just about the simplest code I could come up with to experiment with these functions:
>>
>> #import <Cocoa/Cocoa.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>>
>> int main(int argc, char *argv[])
>> {
>>
>> printf("%d \n", 345);
>> fprintf(stdout, "%d \n", 345);
>> fflush( stdout );
>>
>> NSLog(@"This is from NSLog %d", 789);
>> return NSApplicationMain(argc, (const char **)argv);
>> }
>>
>>
>> The result of the call to NSLog shows up in the Console window, but nothing is shown there for calls to printf or fprintf or anything else in the various permutations that I could think of from this suite of functions.
>>
>> Boyd
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden