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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:58:44+00:00 2026-06-07T08:58:44+00:00

I have some doubt: I want to test whether some arrays, low and high,

  • 0

I have some doubt: I want to test whether some arrays, low and high, have been allocated before function call. The function begins with this test:

bool myMgr::compute(myInput *solvInput, double* low, double* high)
{
   if(high==NULL||low==NULL)
        return false;

   //...
}

Am I testing anything, am I testing it right?

Thanks and regards

  • 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-07T08:58:48+00:00Added an answer on June 7, 2026 at 8:58 am

    You are testing if the two pointers are not NULL, which is what heap allocators will return if they couldn’t allocate enough memory, but you can’t make others assumptions beyond that :

    • They could be != NULL, but initialized by the user : double* ptr = (double*)5;
    • They could or could not be “arrays” at all : you have no informations on the number of elements which were allocated.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some doubt on wget command. Here is the thing I want to
I have some doubt on below code #include<stdio.h> int i=6; int main() { int
I am beginner so have some doubt about Adobe AIR. How do I install
I'm studying javascript for the first time and I've some doubt: I have two
I'm learning some file functions and hence have a doubt. I'm curious about why
I want to have a generic PHP function that builds a mysql query based
I have some doubt to implementation of class and interface I have 2 class
I have some mails in txt format, that have been forwarded multiple times. I
I am a beginner in HTTPS technology :(. I have some doubt regarding the
This is another question from cracking coding interview, I still have some doubt after

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.