my first mac app...

Discussion in 'Mac Programming' started by ryans79, May 5, 2009.

  1. ryans79 macrumors regular

    Apr 12, 2009

    This is my first mac app, works like a charm (as i got it from a book) just want to add a little functionality to it... but dont know how (problem with learning by myself and a book is cant really ask the "instructor" if i want to add something :( )

    Heres the code that i am using:
    Heres what i want to do, in the text where it says Generator seeded, i want to add the srandom number as well.

    I know it must be simple, but since this is my first app im just getting used to the basics.

  2. ryans79 thread starter macrumors regular

    Apr 12, 2009
    couldnt find the word before, but i guess i want to "concatenate" the srandom number after the message.

    Thanks again!
  3. robbieduncan Moderator emeritus


    Jul 24, 2002
  4. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    One possible problem is that srandom returns void, so there's no result to print. If you want to be sure you print the same value as you pass in to srandom, you'll need to store the result of the time call, since this is always changing.

    Once you know what you want to print, look into the things robbieduncan mentioned.

  5. ryans79 thread starter macrumors regular

    Apr 12, 2009
    Will do, i think i just need to keep reading and doing the examples before getting "creative" and extending the functionality.

    I'll come back to this once the book tells me how to go through the documentation, it was mentioned in the earlier chapter, but will be coming up in more detail in the coming chapters.

  6. wrjohns macrumors newbie

    May 4, 2009
    D'oh. totally misread your post. Move along. Nothing to see here
  7. ryans79 thread starter macrumors regular

    Apr 12, 2009
    Now i\m curious!

    What did you think you did see?


Share This Page