Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

about sentinel

What is the meaning of sentinel -999?
Is that the limitation value of StudentNumber?





[code]
#include
#define sentinel -999
int main
{int StudentNumber;
....
....
while(StudentNumber!=sentinel)
{
....
}
return 0;
}


[/code]



Comments

  • Ed HallEd Hall Posts: 395Member
    It looks like it's just a way to break out of the while loop. I would expect that student numbers would all be positive and you can keep entering data until you enter -999. Then the while loop is broken. The term "sentinel" is probably used to signify that it is "watching" for the -999.

    Take Care,
    Ed
  • toddlerasimtoddlerasim Posts: 93Member
    : What is the meaning of sentinel -999?
    : Is that the limitation value of StudentNumber?
    :
    :
    :
    :
    :
    : [code]:
    : #include
    : #define sentinel -999
    : int main
    : {int StudentNumber;
    : ....
    : ....
    : while(StudentNumber!=sentinel)
    : {
    : ....
    : }
    : return 0;
    : }
    :
    :
    : [/code]:
    :
    : That sounds just very right. Like the name "sentinel" for a variable to do just that ... keep watch. Think I will add it to my list of fixed variable names. Thanks for the post.

    But then I am a toddler in C/C++.
    :
    :
Sign In or Register to comment.