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 7937183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:27:30+00:00 2026-06-03T22:27:30+00:00

Asume that f() returns a reference to an integer ( int & f(); ),

  • 0

Asume that f() returns a reference to an integer (int & f();), f()+=5; and f()=f()+5; are different, explain how and give pesudo code for f() to illustrate this difference.

If p is an int *p, what is the difference between, these two statement in C++:

if (p!=NULL && *p !=0).... 
if (*p !=0 && p !=NULL)....
  • 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-03T22:27:31+00:00Added an answer on June 3, 2026 at 10:27 pm

    f()+=5 could be different from f()=f()+5 if f() returned a reference to a different integer at each call. This could only happen if f() read from some global variable which was different each time that it was called.

    The difference between if (p!=NULL && *p !=0) and if (*p !=0 && *p !=NULL) is that the first one checks whether p is null and then checks whether the int that p points to is 0 . The second one only checks whether the int that p points to is 0 (and performs this check twice).

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

Sidebar

Related Questions

Assume that I have this piece of code: @interface Foo : NSObject { Bar
Assume that the following Perl code is given: my $user_supplied_string = &retrieved_from_untrusted_user(); $user_supplied_string =~
I have a place in the code that used to say const myType &
Is it safe to assume that $_SERVER['REMOTE_ADDR'] always returns a IPv4 address ? Thanks!
I'm trying to create an expression tree dynamicly. Let asume that I have two
Assume that I only have a country code (en, de, fr) and I need
So I have a function that looks like this: @SuppressWarnings(unchecked) public static <E> Set<E>
I have a function in C++ that returns a vector<vector<double> > object. I have
I think this code should be fine but Static Analyzer doesn't like it. I
Consider this piece of code: (defvar lst '(1 1)) (defmacro get-x (x lst) `(nth

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.