my first mac app...

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

  1. ryans79 macrumors regular

    Joined:
    Apr 12, 2009
    #1
    Hello,

    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.

    Thanks!
     
  2. ryans79 thread starter macrumors regular

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

    Thanks again!
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    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.

    -Lee
     
  5. ryans79 thread starter macrumors regular

    Joined:
    Apr 12, 2009
    #5
    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.

    Cheers!
    °°
     
  6. wrjohns macrumors newbie

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

    Joined:
    Apr 12, 2009
    #7
    Heh!
    Now i\m curious!

    What did you think you did see?

    Cheers!
     

Share This Page