Your 'operator B' doesn't quite work, so it can't convert.
Making an operator there is tricky, because A doesn't know what the contents of B are yet... So you just have to say that the function exists inside the class, then put the function definition after B is defined.
Last edited by Corona688; 01-29-2014 at 02:00 PM..
Hi,
I've tried to compile a program I wrote with a Makefile, yet it returns an error:
<<<test_log>>>
itest_log.o /sr/local/bin/gcc -o test_log.o -I ../../../include -L ../../../lib -llog_mgr
sh: itest_log.o: execute permission denied
Error code 1
make: Fatal error: Command failed for... (3 Replies)
hi this
i tried for getting url form mozilla window.
and also for getting mozilla object file.
is there any plz tell the way.
thanking u.
ramesh (7 Replies)
I have strings like "$AEUT_BIN/aeutut02.ksh $IFS_MACHINE $AEFA_CONTROL $MVS_CONTROL"
I am looking for a way to find out how to obtain aeutut02.ksh from the above mentioned string in unix shell script. (1 Reply)
I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine.
I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this.
Here is my function:
<?php
function TRECSend($a, $b, $c, $d,... (0 Replies)
Hi,
I was asked this question in interview.can you people please help me out in this.
class A
{
int i;
a()
{
i=10;
cout << i;
}
}
int main()
{
A a(); // what will be the program output
}
Thanks,
Harika (3 Replies)
Hi,
I have defined the class and call the sizeof(object to class) to get the size.
# include <iostream>
# include <iomanip>
using namespace std;
class sample
{
private:
int i;
float j;
char k;
public:
sample()
{
} (2 Replies)
Hi,
I would like to create a shared object ( .so).
This shared object
1. uses the functions from a library.
2. Also it should be able to use the global variable in an app
To achieve this what should I do ? 1) To use the functions in the library should I give the -ld option while... (1 Reply)
I am working on a small columns class, since I use allot of tabular data. I am trying to set up code to allow me to efficiently read in tabular data, manipulate it, and write to output files. I more or less know what I need to do, but there are many options to sort through.
I have the beginnings... (14 Replies)
we have 2.2.0 of opends running on RedHat 2.6.21 and we're trying to setup a structure that will suit our needs. One of the things we'd like to do is create our own custom object classes based off some of the existing ones you get out of the box. The opends documentation covers this here (sorry, it... (1 Reply)
Discussion started by: snafu
1 Replies
LEARN ABOUT PHP
is_a
IS_A(3) 1 IS_A(3)is_a - Checks if the object is of this class or has this class as one of its parentsSYNOPSIS
bool is_a FALSE (object $object, string $class_name, [bool $allow_string])
DESCRIPTION
Checks if the given $object is of this class or has this class as one of its parents.
PARAMETERS
o $object
- The tested object
o $class_name
- The class name
o $allow_string
- If this parameter set to FALSE, string class name as $object is not allowed. This also prevents from calling autoloader if the
class doesn't exist.
RETURN VALUES
Returns TRUE if the object is of this class or has this class as one of its parents, FALSE otherwise.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.9 | |
| | |
| | Added $allow_string parameter |
| | |
| 5.3.0 | |
| | |
| | This function is no longer deprecated, and will |
| | therefore no longer throw E_STRICT warnings. |
| | |
| 5.0.0 | |
| | |
| | This function became deprecated in favour of the |
| | instanceof operator. Calling this function will |
| | result in an E_STRICT warning. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
is_a(3) example
<?php
// define a class
class WidgetFactory
{
var $oink = 'moo';
}
// create a new object
$WF = new WidgetFactory();
if (is_a($WF, 'WidgetFactory')) {
echo "yes, $WF is still a WidgetFactory
";
}
?>
Example #2
Using the instanceof operator in PHP 5
<?php
if ($WF instanceof WidgetFactory) {
echo 'Yes, $WF is a WidgetFactory';
}
?>
SEE ALSO get_class(3), get_parent_class(3), is_subclass_of(3).
PHP Documentation Group IS_A(3)