Topic — Add New » Posts Last Poster Freshness
Virtual Mechanism 2 kartik 1 month

Can pure virtual functions have a body?

Constructor 2 kartik 1 month

Can constructors be overloaded? If no,how to prove it?

Static funda 1 Aashish Barnwal 1 month

Why static data members cannot be initialised by initialiser list but can be initialised in the body of constructor?

Static funda 1 Aashish Barnwal 1 month

Why static member functions cannot work upon non-static data members?
It should work when it is called with the object name.

pre-increment and post increment revisited 2 Aashish Barnwal 1 month

could you or anyone else xplain the output to me for the code as follows -:

int a,b,c;
a=0;
b=0;
c=(a++)+(++a)+(++a);
printf("a=%d\n",a);
printf("b=%d\n",b);
printf("c=%d\n",c);

I felt the output should be a=3,b=0,c=5..
however correct output is
a=3
b=0
c=4

pre-increment and post increment 3 dexter 1 month

guys.....could you please help me with the concept of preincrement and post-increment i.e
[b]++a[/b] and [b]a++[/b].......
I always end up having a doubt in this case ??
thank you ......

constructors in c++ 3 Aashish Barnwal 1 month

can a constructor be private in c++

[C++]Samsung Interview question 4 Aashish Barnwal 1 month

Can we override or overload a static member function at any point of time?

Given an array shuffle all its contents randomly. 3 2 months

You may know its algorithm.. :) But code required (A Bit stupid point :D :D ) !!!
But still it is good one :) :)

Adobe Interview Question for Software Engineer/Developer (Fresher) about Algorithms, Aptitiude, C++, 4 5050 2 months

Given 2 trees A and B find if tree B is a subtree of Tree A or not. Provide the most optimized solution that you can think of.

Adobe
predict output 4 kartik 2 months

void main(){
static char s[]="Hi Goodie";
int i=4;char ch;
ch=s[i++];printf("\t %c",ch);ch=++i[s];printf("\t %c",ch);
ch=++i[s];printf("\t %c",ch);ch=i++[s];printf("\t %c",ch);
ch=s[++i];printf("\t %c",ch);ch=i[s]++;printf("\t %c",ch);}

C++ Question 2 geek4u 2 months

I have problem in this program please HELP me

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class myclass
{
	int x,y,z;
	public:
	myclass()
	{
		x=y=z=0;
		cout<<"Default constructor\n";
	}
	myclass(int a,int b,int c)
	{
		x=a;y=b;z=c;
		cout<<"Parameterized constructor\n";
	}
	~myclass()
	{
		cout<<"Default Destructor\n";
	}
	void *operator new(size_t s)
	{
		void *p;
		p=malloc(s);
		cout<<"Memory Allocated\n";
		return p;
	}
	...
how to debug the c code............? 5 rajeevpodar 3 months

unsigned int a, b, c;
/* a and b are assume to have some values */
c = (a + b) / 2; // <- There is a bug in this st
What is the bug? and how you debug it?

what is the output ?? and why 2 kartik 3 months

int a[1],b[1];
a[0]=1;
b[0]=2;
b[1]=4;
int *num1;
num1 = &b[0];
a[1]= static_cast<int>(*(num1));
cout<<a[0]<<endl<<a[1]<<endl<<b[0]<<endl<<b[1];

Regarding Heap for Dynamic memory allocation 4 geek4u 3 months

Can somebody put more flash on Heaps used for Dynamic memory allocation. I want know what exactly happens on the front of Operating Systems side.
For e.g: we say when we do malloc or new, we get memory block from heap and then we can use that much memory in our program.

What kind of heap is this ? (Min heap/max heap/ fibonacci heap ??)
How OS decides which memory block to give it to program ?
How does heap overcome memory fragmentation issues ?

Any answer, sugg...

Looping without using looping statements or recursion. 11 avdd80 3 months

Print 1 to n without using looping statement or recursion!

Microsoft Interview Question for Software Engineer/Developer (Fresher) about C++ 3 Aashish Barnwal 3 months

Under which conditions the default assignment operator is not generated by the compiler for your class? (assuming that you do not declare the assignment operator yourself)

Microsoft