- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
11 Posted Topics
Hi, Please tell me in the following question why no copy constructor is called when fun returns the A object. While returning b and constructing c, there is no copy constructor called. Why?? #include<iostream> using namespace std; class A { public: A(){cout <<"Default\n";} A(const A&){ cout<<"copy\n"; } A fun(A a) … | |
Hi All, Why the output of the following program is 0231?? Please resolve my doubt. #include <iostream> using namespace std; class B { int data; public: B() { data =0;} int func(){cout<<data++;return data++; } }; int main() { B b; cout<<b.func()<<b.func()<<endl; return 2; } | |
Hi All, Pleas tell me why the following program is giving 35 as output?? if fun() returns int type then it is compilation error. why? #include<iostream> using namespace std; int &fun() { static int x = 10; return x; } int main() { fun() = 30; cout << fun(); return … | |
Hi All Can somebody clear my query that why the second operand of '+' operator is called first in the code below? When operator '+' takes left to right. #include <iostream> using namespace std; class A { int i; public: A(int i=-1){cout<<"A const i = "<< i <<endl;} int operator+(const … | |
Hi All, Could you please clear my doubt why this second catch block is called when exception is thrown only once. #include <iostream> using namespace std; class E { public: const char* error; E(const char* arg): error(arg) {} }; class B { public: B() {}; ~B(){cout<<"~B() called"<<endl;} }; class D: … | |
Hi all, Please answer this question. Why the output is ACA?? In the line obj = obj+6; the 6 should have been converted to obj type but, why it is converting the obj to int type? Please help... #include <iostream> using namespace std; class Base { public: Base(int m_var=1):i(m_var){ cout<<"A"; … | |
How come foo(3,3.14); Doesn't work but Goo(3,3.14); works? Please reply. #include <iostream> using namespace std; double foo(double a, double b) { cout<<"foo(double a, double b)"<<endl; } int foo(int a, int b){ cout<<"foo(int a, int b)"<<endl; } double Goo(float a, float b){ cout<<"Goo(float a, float b)"<<endl; } int Goo(int a, int … | |
How come the output of this program is 1413, I expected it to be 1414. (i + 1)->value() should have called R::value(). is n't it? #include<iostream> #include<vector> using namespace std; class Q { public: Q(int n = 0) : m_n(n) { } virtual int value() const { return m_n; } … | |
I want to learn multithreading in C++. somewhere on internet I got a piece of code using popen() function of stdio.h. I just wanted to know that if this function helps in creating the new threads or it doesn't come under multithreading. Please guide me in multithreading. | |
Re: Floats and doubles can't be compared using relational operators. That may be the issue. you can search web for how to compare floats. [QUOTE=harsha_123;1728940]I'm new to c++. I was studying data structures and came to know Linked Lists Lately. We had a problem of finding an item stored inside a … | |
|
The End.