Register
 

Free CSC Scholarship support for 2018-19

Engineering, Computer, Scholarship and SEO Support Forum



Author Topic: The statement if {myptr != NULL}  (Read 492 times)

Offline mechanic

  • Engineer
  • Hero Engineer
  • *****
  • Posts: 3062
    • View Profile
    • Engineering Forum
The statement if {myptr != NULL}
« on: February 26, 2017, 07:24:02 PM »
Advertisement
Question: The statement

if {myPtr != NULL}
      *myPtr = NULL ;
else
      *myPtr = NULL ;

has same effects as the statement(s)

A. if {myPtr} *myptr = NULL ;
    else *myPtr = NULL ;
B. *myPtr = NULL;
C. if {!myPtr} *myPtr = NULL ;
       else *myPtr = NULL ;
D. if {myPtr == NULL} *myPtr = NULL ;
    else *myPtr = NULL;

Correct answers are:

All options are correct


A. if {myPtr} *myptr = NULL ;
    else *myPtr = NULL ;

B. *myPtr = NULL;

C. if {!myPtr} *myPtr = NULL ;
       else *myPtr = NULL ;

D. if {myPtr == NULL} *myPtr = NULL ;
    else *myPtr = NULL;


Engineering, Computer, Scholarship and SEO Support Forum

The statement if {myptr != NULL}
« on: February 26, 2017, 07:24:02 PM »