Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Length of Sequences in an array.

  • 14-04-2008 7:09pm
    #1
    Registered Users, Registered Users 2 Posts: 3,073 ✭✭✭


    .


Comments

  • Registered Users, Registered Users 2 Posts: 86,729 ✭✭✭✭Overheal


    you would need an integer counter to keep track of your instances of 1 for a start. When a 1 is encountered you ++counter; else reset the counter to 0 and store the counter's value in a seperate int max. If the counter later, is > max, then max = counter.

    edit: hey nothing to be ashamed about I've pulled out more hair forgetting to add the second '=' in my if statements. But dont go deleting your posts.


  • Registered Users, Registered Users 2 Posts: 3,073 ✭✭✭iseegirls


    .


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Do not delete your posts. What if someone else had the same issue?


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    What hobbes said. Me thinks its time for me to start applying the rules around here.


  • Registered Users, Registered Users 2 Posts: 1,119 ✭✭✭Donald-Duck


    Overheal wrote: »

    edit: hey nothing to be ashamed about I've pulled out more hair forgetting to add the second '=' in my if statements. But dont go deleting your posts.


    The amount of times I've done that :( thank god eclipse points it out for me


  • Advertisement
Advertisement