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

Halfmaster1

macrumors newbie
Original poster
Dec 28, 2010
19
0
Hello. As you can see, I'm new here, so I'm probably breaking some rule, but oh well. I have read pa very good tutorial in c, and I decide to try it. I already know GML, which is very similar to c. I think it actually turn the GML to c++ before compiling it, but that's beside the point.


Anyways, I downloaded Xcode, (I have snow leopard by the way), and I went back to the start of the tut, and it said to run the default code to make sure it works, and I did, but the words hello world didn't appear. As a matter a fact, nothing much happened at all. A bar popped up for a moment, not long enough to read, then it said it had compiled successfully, but the running window didn't pop up. I think it has something to do the the pound include at the to ( which is there) but I don't know what. Please help, I'm really excited to try it out.

And, I know there are some other #include things for the start, what are some that I should include, and what's the bool one again?

Thsnkyou.
 
Hello. As you can see, I'm new here, so I'm probably breaking some rule, but oh well. I have read pa very good tutorial in c, and I decide to try it. I already know GML, which is very similar to c. I think it actually turn the GML to c++ before compiling it, but that's beside the point.


Anyways, I downloaded Xcode, (I have snow leopard by the way), and I went back to the start of the tut, and it said to run the default code to make sure it works, and I did, but the words hello world didn't appear. As a matter a fact, nothing much happened at all. A bar popped up for a moment, not long enough to read, then it said it had compiled successfully, but the running window didn't pop up. I think it has something to do the the pound include at the to ( which is there) but I don't know what. Please help, I'm really excited to try it out.

And, I know there are some other #include things for the start, what are some that I should include, and what's the bool one again?

Thsnkyou.

If you're in a .c file, #include <stdio.h>

If you're in a .cpp or .cc file, #include <cstdio>
 
I can't remember if the menu is Run or Compile, but choose Console from one of those menus. This is where you'll see console I/O.

-Lee
 
I think even Brits call it "hash include", not "pound include". But please do correct me if I'm wrong...
 
Okay.

Just double checking.

printf(string)

should display that string in a window, no?

Because it doesn't.
 
Okay.

Just double checking.

printf(string)

should display that string in a window, no?

Because it doesn't.

No. It writes to stdout. If you run from Terminal it will show up there, if you run from XCode you need to bring up the console as I said earlier.

-Lee

EDIT: I just looked at GML. It is close enough to C to make you think you know some C, but far enough away that you need to treat C as something brand new, and assume you know absolutely nothing about C syntax and behavior.
 
Last edited:
Thanks. I thought you were talking about something else entirely.

It's now generating primes, it's up over 1,000,000 already. Still probably a few hours to go. Might jump ahead, to a much higher number.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.