Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:29:02+00:00 2026-06-01T14:29:02+00:00

I need to check a variable vi_theIndex for its value. At the given moment

  • 0

I need to check a variable vi_theIndex for its value. At the given moment it has a value of 65.

I want to check if vi_theIndex is bigger or equal to zero AND smaller than 32.
Right now I do it like this:

long long vi_theIndex = 65;
if ((vi_theIndex >= 0) && (vi_theIndex < 32) )
 {
   //Case true
 }
else
{
   //Case false
}

I realized that the results are wrong for 65. The second case should come up but the first case becomes true. Why is this?

I tried this:

long long vi_theIndex = 65;

bool limitFlag1, limitFlag2;

limitFlag1 = (vi_theIndex <= 0);
limitFlag2 = (vi_theIndex = 65);

limitFlag2 becomes true and limitFlag1 becomes undefined, the debugger doesn´t even stop there on my breakpoint. It looks like C doesn´t understand the ‘<‘, ‘<=’ or ‘>’ signs. This also happens when I use the ‘<‘ or ‘>’ sign alone like here:

limitFlag1 = (vi_theIndex < 0);

limitFlag1 is not defined.

Can somebody please shed some light on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:29:04+00:00Added an answer on June 1, 2026 at 2:29 pm

    You must not be showing your real code for your first example – as you say, “case false” should be executed.

    Your second example has a problem – you have vi_theIndex = 65, rather than vi_theIndex == 65, which you probably meant. The statement as you have it is always true. limitFlag1 will be 0 – I’m not sure what you mean by it “becomes undefined” – are you not showing your real code here, too?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to check if the variable has value of string which starts with
I need to check to see if a variable contains anything OTHER than a-z
In my app in android I need to check if a variable has been
I need to check that a variable has one of a few different values.
I need to check to see if a variable is null or has all
I need to check the value of a particular variable alone from set of
I need to check if a variable I have is of the data type
Is this a possible function? I need to check if a variable is existent
For a check i need yesterday's date at 10:00pm in a variable. I get
i want something like this the user enter a website link i need check

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.