GeekInterview.com
Series: Subject:

OOPS FAQ

Showing Questions 1 - 20 of 270 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

are the expressions arr and &arr same for an array of integers?

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: Mohamed on: May 8th, 2013

Actually arr and &arr are different. arr holds the base address of the array arr[], but &arr holds the address of the entire array. but both expressions points to the same base address.{geshibot langu...

Answered by: KishoreKNP on: Dec 4th, 2009

Arr and &Arr both are same, which will return the address of first element of the array. For example

void main()
{
   char arr[10] = "Kishore";
   printf("n%u : %u", a, &a);
}
Output:
~~~~~

65516 : 65516

which header file should you include if you are to develop a function which can accept variable number of arguments?

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: hema mathivanan on: Apr 29th, 2013

Code
  1. #include stdarg.h

Answered by: Ajay Kanse on: Jul 1st, 2007

stdarg.h

how do you declare the following: an array of three pointers to chars an array of three char pointers a pointer to array of three chars a pointer to function which receives an int pointer and returns...

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: hema m on: Apr 29th, 2013

answer for 1 & 2 are same

Answered by: visiuna on: May 19th, 2008

Hi shilpagore,
Thank u for ans's  but there totally 5 questions in that. so if u don't mind pls do read question carefully and can u post the ans's please.
Thank you.

What is memset, and why it is used, when it is used?

Asked By: psunitha | Asked On: Aug 31st, 2007

I need a simple example progam for this with clear definition

Answered by: Vinay on: Jan 22nd, 2013

This code gives warnings which is not the good sign while dealing with the network programming.

Answered by: vignesh1988i on: Oct 4th, 2009

How will this memset() function willl handle the worst case (ie) when the string is lesser than the given length
If my string is  
 
char string[]="i love my india";
If I use the function memset(string, '*' , 20);

Will it handle these type of complexities?

explain working of printf.

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: praveen on: Jan 1st, 2013

printf means it prints the user statements

Answered by: unrealvicky on: Aug 17th, 2010

Printf is a Variadic function. Variadic functions are functions which may take a variable number of arguments and are declared with an ellipsis in place of the last parameter. int printf(char *, ...);...

what are the different types of polymorphism?

Asked By: Interview Candidate | Asked On: Sep 1st, 2005

Answered by: Have Fun on: Dec 28th, 2012

Two:
Ad-hoc polymorphism and universal polymorphism

Answered by: kutty on: Sep 24th, 2012

how to write a simple java programs for overloading & overriding

Merits and demerits of friend function

Asked By: nitin sharma | Asked On: Jun 5th, 2006

Answered by: yogesh anasane on: Nov 21st, 2012

1) Sometimes a friend function allows a more obvious syntax for calling a function rather than what a member function can do.
2) Friend function is used to increase versatility of overload operator.

Answered by: Prabhu Kumar V a on: Jun 14th, 2006

merits:   we can able to access the other class members in our class if,we use friend keyword.   we CAN access the members without inheriting the class.demerits:  Maximum size...

write a program to interchange 2 variables without using the third one.

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: dhruv sood on: Nov 5th, 2012

with output

Answered by: heera lal on: Jun 26th, 2009

#include<stdio.h>
#include<conio.h>
void main
{

int a,b;
printf("enter the two no");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);
getch();
}

how can I call a function, given its name as a string?

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: neeraj on: Oct 26th, 2012

ya it possible by using macro

Code
  1. #include<stdio.h>
  2. #define string sum1()
  3. int main(){
  4.  
  5. int k=string;
  6. printf("%d",k);
  7. getch();
  8. return 0;
  9.  
  10. }
  11. sum1()
  12. {
  13. int c=6;
  14. int d=7;
  15.  return(c+d);
  16. }

Answered by: jbanx on: Jun 6th, 2007

Hi, This is a typical example of reflection. If you are using .NET then use reflection for this purpose. In this case you create an object of a particular  type and the invoke methods at run time by passing function name.

What is the difference between the object based language and object oriented langauage?

Asked By: Rajesh | Asked On: Mar 7th, 2006

Answered by: neeraj on: Oct 19th, 2012

The object oriented language support the extra two concept that is dynamic binding and inheritance..but in second case they do not support these 2 features...

Answered by: priya on: Feb 3rd, 2012

The main diffrence between object oriented and object based languages is object based languages doesnt support Inheritance where as object oriented supports. C# is a object oriented language because it supports inheritance and ASP.Net is not a langugae it is a technology.

write a program to find the factorial of a number

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: richa on: Oct 10th, 2012

Code
  1. class fact
  2. {
  3. public static void main (String orgs[])
  4. {
  5. int n,fact=1;
  6. for(a=n;a>0;a--)
  7. {
  8. fact=fact*n;
  9. system.out.println("factorial of the no is"+fact);
  10. }
  11. }
  12. }

Answered by: Sheenu on: Sep 27th, 2011

//program to find the factorial of a number

Code
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. int a,fact=1;
  6. for(a=1;a<=5;a++)
  7. fact=fact*a;
  8. }
  9. printf("%d",fact);
  10. getch();
  11. }

Explain the advantages of OOPS with the examples.

Asked By: Bir Bahadur Karki | Asked On: Oct 31st, 2006

Answered by: rajanish jha on: Oct 8th, 2012

The main advantage is that it uses real world object and generic programming approach

Answered by: manisha chandani on: Aug 24th, 2012

It is good because it is totally based on objects. It provides the concept of inheritance, encapsulation, polymorphism. With the help of this concepts the code is reusable, get in many forms. Classes support encapsulation.

Design coffee vending machine

Asked By: selvarajc | Asked On: Sep 29th, 2012

How to design coffee vending machine in Java

what are the advantages of inheritance?

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: Brijendra on: Sep 23rd, 2012

1) Inheritance is the concept where the child class can concentrate on new features that it want. because all the basic features it will get it from its parent class.

2) It is about re-usability of features.

Answered by: manisha chandani on: Aug 24th, 2012

Helps in reusability of code.
Program development time is reduced.
Helps as security purpose.

What is an abstract class

Asked By: jyothis | Asked On: Oct 7th, 2005

Answered by: manisha chandani on: Aug 24th, 2012

Abstract class is a class which contains atleast one abstract method.
Abstract method-method whose body is not defined.
Object of abstract class cannot be created.

Answered by: vijin on: Apr 9th, 2012

abstract class is a base class. It is only declare a method and implement this method in a derived class using the override method.
it is declare a abstract keyword, and no need for create object for abstract class.

Dispose()and close() method

Asked By: ajit008 | Asked On: Jun 23rd, 2012

Difference between dispose()and close() method

Answered by: mohammad imran on: Jun 28th, 2012

The basic difference b/w close() & dispose() method is , when a close() method is called , any manage resource can be close temporarily and can e opened once again. It means that, with the same objec...

What are the types of inheritance?

Asked By: pradeeppk | Asked On: Sep 23rd, 2005

Answered by: gowtham on: Feb 28th, 2012

Creating a new classes from exiting classes
5 type

Answered by: ruchika arora on: Feb 27th, 2012

There are 5 types of inheritance: -
1. Single inheritance
2. Multilevel inheritance
3. Multiple inheritance
4. Hierarchical inheritance
5. Hybrid inheritance

Static destructor

Asked By: charu aggarwal | Asked On: Aug 20th, 2010

Why we use static destructor? What is its scope and what is its implementation?

Answered by: on: Nov 7th, 2011

You cannot declare destructor as static.
Destructors cannot be declared const, volatile, const volatile or static.

Refer:
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr380.htm

static ~Sample()
{
std::cout<<"Destructor
";
}
The above code snippet shows following error.
error C2574: 'Sample::~Sample(void)' : cannot be declared static

explain one method to process an entire string as one unit?

Asked By: Interview Candidate | Asked On: Jun 24th, 2005

Answered by: Ayushi Gupta on: Oct 15th, 2011

using gets we can enter the entire string

Answered by: raja_k450 on: Mar 19th, 2008

 there is no way to process an entire string.it has to be done char by char

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.