If both str1 and str2 are NULL (meaning set to null or the end of a string) it returns the value TRUE.
If either variable is pointing to content, it returns the value FALSE.
return ends the call to this function and passes back a value to the caller.
2007-03-03 12:33:25
·
answer #1
·
answered by Vegan 7
·
0⤊
0⤋
The code doesn't mean a thing...it's wrong.
why...
1.Functions can return only one value at a time...i mean one instance ..say the starting address of a
string and in this way the whole array of elements can be accessed.
In this case the function is trying to return more than one instance.This is illegal operation
2.The operator "==" stands for comparison and return statement doesn't contain any..
If u are trying to assign values NULL then it should be
return(* str1=NULL);
if you are working under certain conditional constraints use
if(condition)
{
return(* str1=NULL);
}
else
{
return(* str2=NULL);
}
2007-03-04 11:54:59
·
answer #2
·
answered by fire_kops 1
·
1⤊
0⤋
Don't get confused by the * sign before str1 and str2. The star means that str1 and str2 are pointers, NOT variable. They are pointers to the variables. Still, it does pretty much the same job here in this if statement.
Hence, the above statement will return true only when str1 and str2 are both NULL.
Hope this helps!
2007-03-03 19:34:38
·
answer #3
·
answered by A.Samad Shaikh 2
·
0⤊
0⤋
Just as it says, it means return true if the contents of str1 is a NULL pointer AND the contents of str2 is a NULL pointer.
2007-03-03 19:07:10
·
answer #4
·
answered by Larry 6
·
0⤊
0⤋
this means return 0 if BOTH str1 AND str2 pointers point to NULL else return any value (non zero).
the code here checks the pointer str1 if it points to NULL the other pointer is checked if it points to NULL, if both checks are true the function returns true(non zero value in C/C++), else the function returns ZERO (false in C/C++).
2007-03-03 19:09:25
·
answer #5
·
answered by Pharoah 2
·
0⤊
0⤋