Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jayomat

macrumors 6502a
Original poster
Jan 10, 2009
703
0
Hi all,
im a newb with some java experience, playing around with the xcode. however, i just installed xcode and startet a new "cocoa application" projekt (macosx). i opened "Other Sources" => "main.m" and replaced the code in there with these lines:

#import <stdio.h>

int main(int argc, char *argv[])
{
int sum;

sum = 50 + 25;
printf ("The sum of 50 + 25 is %i", sum);
return 0;
}

when i hit "build and go", shouldnt that print the line "The sum of 50 + 25 is 75" on terminal ??? i dont understand why it doesnt work. can someone help me out?

thanks a lot!
 

Howiieque

macrumors regular
Feb 1, 2009
120
0
the output display on the console. after build and go. Press command+option+r, you will see the result.

then check out the project folder, in the debug, you will find your app. run it. that goes to the terminal.

By the way, if you just want a command line thing, create a command line utility-->foundation tool.:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.