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

  • Home
  • SEARCH
  • 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 6195357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:27:17+00:00 2026-05-24T03:27:17+00:00

For example: if(pos == -1 || character_array[pos] == 0) { } If pos is

  • 0

For example:

if(pos == -1 || character_array[pos] == 0) {

}

If pos is -1, can I count on this NEVER crashing?

Same goes with AND statements in which the first conditional fails.

  • 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-05-24T03:27:18+00:00Added an answer on May 24, 2026 at 3:27 am

    Yes, you can count on this. The relevant parts of the C standard are 6.5.13:

    Unlike the bitwise binary & operator, the && operator guarantees
    left-to-right evaluation; there is a sequence point after the
    evaluation of the first operand. If the first operand compares equal
    to 0, the second operand is not evaluated.

    and 6.5.14:

    Unlike the bitwise | operator, the || operator guarantees
    left-to-right evaluation; there is a sequence point after the
    evaluation of the first operand. If the first operand compares unequal
    to 0, the second operand is not evaluated.

    For example, the following is idiomatic C:

    if (foo && foo->bar > 10)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example I have: pos(10, 20). How can i write the predicate which returns
Example: The user login to the webpage => Click on a button This action
Example int *ptr; *ptr = 1000; can I catch memory access violation exception using
For example sprintf(pos,%f ,cl.snap.ps.origin[0]); //don't start with strcat sprintf(tmp,%f ,cl.snap.ps.origin[1]);strcat(pos, tmp); fine. with sprintf(tmp,%f
I'm reading through an example in primer and something which it talks about is
i can't find an example on dragging (and dropping) multiple elements with Qt/PyQt; In
I have been trying to find a collision avoidance example that I can adapt
I'm trying to follow this example to add a tooltip to a flot graph.
in the following indexer code block, why do we need: public string this[int pos]
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe

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.