About TheJoey.Net

TheJoey.Net is the weblog of Joe Casabona, a web developer who attends the University of Scranton, now for Graduate Studies. He is real bad at writing these about pages and hates writing in the 3rd person...more

**The layout is new and there might be some bugs. If you see any, please email me at Joe@Casabona.org

This semester I am taking a class where it was recently decided the primary language will be C. While I did dabble in C a little bit last semester, I didn’t do all that much. This evening I did our first assignment, which was a simple “Hello World” program in C, programmed on a UNIX machine I telneted into. Here is my slightly more complicated program and some explanation:

C

While I would be able to achieve this by printing printf("Hello World");, I wanted to illustrate character arrays and pointers in my program. I stored the string “Hello World” in a character array, because C does have a String object, or any objects for that matter. This will probably be the hardest thing for me to adjust to in C. The line that reads float *ad= &prt is simply assigning a ‘pointer’ variable. In C you can access the actual memory address of anything variable in the program. this is what ‘ad’ is. ‘&prt’ is the actual value stored in the variable ‘prt’. Without the &, I would be getting the address of ‘prt’, and not the actual value. I then print the string, and the address the string is stored in.

I understand that anyone who has never seen C probably thinks this is very difficult, but I hope to add a few more posts about C, looking more in depth into pointers, addresses, and printf(), among other things. Later!

Comments

  1. greg terlecky

    September 19th, 2006/1:56 PM

    yea dude
    public class hello
    {
    public static void main (String args[])
    {
    System.out.print(”Hello World”);
    }
    }

    rofl

    i was looking at it and was like y is there an array lol

    is there a toString or a tokenizer function?

  2. Mike Quinn

    September 22nd, 2006/11:21 PM

    Several weeks ago they came out with a new eLoader for the psp to play old homebrew.

    First thing they did was Hello World

    It was more of a “Fuck You Sony Security Checks”

Leave a Reply