8 More Discussions You Might Find Interesting
1. Programming
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
Discussion started by: anand.shah
2 Replies
2. Programming
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies
3. Programming
Hi,
I am designing the look-alike C++ string class:
#include <iostream>
#include <cstring>
#include <exception>
#include <new>
#define ALLOC(N) (char*) new char
#define DELETE(P) delete ((char*)(P))
class String {
public:
// conversions: to C-like type char
operator const... (2 Replies)
Discussion started by: royalibrahim
2 Replies
4. UNIX for Advanced & Expert Users
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
5. Programming
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Discussion started by: xavipoes
5 Replies
6. Programming
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)
Discussion started by: pogdorica
7 Replies
7. UNIX for Dummies Questions & Answers
im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies
8. Shell Programming and Scripting
i want to make a shell program.
This program i give a current day and the result is to appear
the celebrity and birthday(birthday and celebration is 2 txt files).
In addition this procedure must do for a space day in future or past depend
on user choice. Finally the program can run and as... (2 Replies)
Discussion started by: mytilini boy
2 Replies
SIMPLEXML_IMPORT_DOM(3) 1 SIMPLEXML_IMPORT_DOM(3)
simplexml_import_dom - Get a SimpleXMLElementobject from a DOM node.
SYNOPSIS
SimpleXMLElement simplexml_import_dom (DOMNode $node, [string $class_name = "SimpleXMLElement"])
DESCRIPTION
This function takes a node of a DOM document and makes it into a SimpleXML node. This new object can then be used as a native SimpleXML
element.
PARAMETERS
o $node
- A DOM Element node
o $class_name
- You may use this optional parameter so that simplexml_import_dom(3) will return an object of the specified class. That class
should extend the SimpleXMLElement class.
RETURN VALUES
Returns a SimpleXMLElement or FALSE on failure.
Warning
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on
Booleans for more information. Use the === operator for testing the return value of this function.
EXAMPLES
Example #1
Importing DOM
<?php
$dom = new DOMDocument;
$dom->loadXML('<books><book><title>blah</title></book></books>');
if (!$dom) {
echo 'Error while parsing the document';
exit;
}
$s = simplexml_import_dom($dom);
echo $s->book[0]->title;
?>
The above example will output:
blah
SEE ALSO
dom_import_simplexml(3), "Basic SimpleXML usage".
PHP Documentation Group SIMPLEXML_IMPORT_DOM(3)