Omgili - forum search, search forums  
  

Discussions about cout derived

Displaying 1 - 10 out of 999 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
I want to print out a function pointer using cout, and found it did not work. But it worked after I converting the function pointer to (void *), so does printf with %p, such as #include <iostream> using namespace std; int foo() {return 0;} int main...
Started by on , 6 posts by 6 people.  
Regarding your edit; ++first) { std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)*first << ' '; } std::cout....
To cout is the right thing (TM) to do in C++ if you want to see their values.
Hi, Is it possible to access a base class function which has the same signature as that of a derived class function using a derived class object?. here's a sample of what I'm stating below.. class base1 { public: void test() {cout<<"base1"<<...
Started by on , 3 posts by 3 people.  
Class.
Test() You cant override a method in derived class if you dint provide a virtual key word..
Hi, I have a question about C++, how to assign a Base object to a Derived object? or how to assign a pointer to a Base object to a pointer to a Derived object? In the code below, the two lines are wrong. How to correct that? #include <iostream> ...
Started by on , 6 posts by 6 people.  
If it's a case of assigning an A that....
Now if you would tell us, what exactly you want to achieve, we might help you .
The other way around (assigning Derived to Base) works, because Base is a subset of Derived.
Prevents you from doing that.
Ask your Facebook Friends
Class Base { public: void foo() const { std::cout << "foo const" << std::endl; } }; class Derived : public Base { public: void foo() { std::cout << "foo"<< std::endl; } } I want to make sure that foo() const is correctly hidden...
Started by on , 7 posts by 7 people.  
Simply by defining a member function foo in the derived class,....
) { cout << d; } }; class Derived : public Base { void foo(int i) { cout << you don't see the Derived's "foo" hiding the "foo" from the Base.
Can someone please put me out of my misery with this? I'm trying to figure out why a derived operator== never gets called in a loop. To simplify the example, here's my Base and Derived class: class Base { // ... snipped bool operator==( const Base& other...
Started by on , 6 posts by 6 people.  
For derived classes to....
It sounds like you want to look could have an overloaded operator== in your derived class that would be able to handle Derived objects.
From base to derived, you are actually creating a new function.
What's the difference between a derived object and a base object in c++, especially, when there is a virtual function in the class. Does the derived object maintain additional tables to hold the pointers to functions?
Started by on , 12 posts by 12 people.  
derived - is the object....
Virtual() {cout << "Derived::Virtual" << endl;} void NonVirtual() {cout << "DerivedDerived is Base, but Base is not a Derived base- is the object you are deriving from.
I know that the derived class can't access the private members of the base class, so why does the derived class inherit the private members of the base class? Is there any case that it is useful? Thanks!
Started by on , 9 posts by 9 people.  
The reason is because derived....
An instance of the derived class contains instances by that question.
The derived class doesn't "inherit" the private members of the base class in any way - it can't access them, so it doesn't "inherit" them.
Given: #include <iostream> using namespace std; struct Concrete { char name[20]; char quest[20]; char favorite_color[13]; }; struct Concrete_with_knobs : public Concrete { int knobs[1 ]; }; Concrete * cradle() { return new Concrete_with_knobs; }...
Started by on , 4 posts by 4 people.  
Derived : public Base{ int j; }; will any conformant C++ compiler leak memory in the following cases: // 1 Base* b1 = new Derived(); delete b1; // 2 Base* b2 = new Derived(); void* vp = b2; delete static of the dynamic type (Derived....
Hello Group, I am working on a legacy framework. Lets say 'A' is the base-class and 'B' is the derived class. Both the classes do some critical framework initialization. FWIW, it uses ACE library heavily. I have a situation wherein; an instance of 'B'...
Started by on , 6 posts by 6 people.  
A solution might be to have a helper object passed from the ....
At the time the constructor of the base class run, the object of the derived class basically doesn't exist.
It really shouldn't be that way.
In the constructor in a derived.
Hi I'm having problems selecting the correct version of a templated class which has an explicit specialization. I'm wanting to select a specialization using a derived class of the class used to specialize. The scenario is: #include <stdio.h> class...
Started by on , 7 posts by 7 people.  
You can convert a derived object to a base object implicitly::cout << Foo<A>::fooBar() << std::endl; std::cout << Foo<B>::fooBar() << std::endl; std::....
That won't really do you any good though.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost