GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 54 of 63    Print  
What are enumerators? and what are in-line functions? giv ans with eg.

  
Total Answers and Comments: 2 Last Update: January 07, 2008     Asked by: vinayakpalande 
  
 Sponsored Links



 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 30, 2007 03:24:49   #1  
kamal7725 Member Since: November 2007   Contribution: 15    

RE: What are enumerators? and what are in-line functions? giv ans with eg.
enum's are data type, while in-line functions are function.
enum are integer repesentation in understandable form like-
enum {
monday,
tuesday,
...
...
sunday
};

now if compare like
if( 1== sunday) condition will return true.


in-line functions are the ones which get insert into the code where they are called.
The difference between function and in-line function is no call will be made to the in-line function during execution. using this one can improve execution performance. this capability is compiler dependent and also depend on the optimization settings.

 
Is this answer useful? Yes | No
January 07, 2008 05:32:33   #2  
inbox4rakesh Member Since: January 2008   Contribution: 2    

RE: What are enumerators? and what are in-line functions? giv ans with eg.
Enumerators: Enumerators are a way to give related constants a human understandable name for better code readability. For example:

We can use the following statement to check whether the connection to an SQL Server is open or not with the following statement

if(cnConnection.State ==1)
{
  //Code to be executed when the connection is open
}

However, the following code makes it more readable,

if(cnConnection.State ==ConnectionState.Open)
{
  //Code to be executed when the connection is open
}

Enumerators are declared in the following way (The syntax may differ from language to language):

public enum <enumName>{name1,name2,name3,...}

example:

public enum DAYS { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday};


Inline Functions:
Generally, during the execution of a program whenever a call to a function is encountered, the control switches from current execution to the method and vice versa. This impacts the overall performance of code execution. In order to remove this switching, Inline functions are used. It is made possible in the following way:

Whenever, the program gets compiled the inline functions get inserted at the calling location so that the execution does not switch in memory locations, and thus improving the program performance.

As already mentioned in the previous thread by Kamal, this is a compiler specific option.

 
Is this answer useful? Yes | No

 Related Questions

Abstraction is defined as hiding details from the end user who should be in no way concerned about the details of the internal mechanism on implementation...but then the same can be achieved in C also 
View Question | Asked by : Adit Agarwal

Latest Answer : Enumerators: Enumerators are a way to give related constants a human understandable name for better code readability. For example:We can use the following statement to check whether the connection to an SQL Server is open or not with the following statementif(cnConnection.State ...


 Sponsored Links



 
Related Articles

Microsoft AJAX Library - Anonymous Functions

Anonymous Functions Anonymous functions can be created adhoc and used instead of a named function Although this can hinder readability when the function is more complex you can do this if you don t intend to reuse a function s code In the following example we pass such an anonymous function to Displ
 

Microsoft AJAX Library - Functions as Variables

Functions as Variables In JavaScript functions are first class objects This means that a function is regarded as a data type whose values can be saved in local variables passed as parameters and so on For example when defining a function you can assign it to a variable and then call the function thr
 

Microsoft AJAX Library - JavaScript Functions

JavaScript Functions A simple fact that was highlighted in the previous chapter but that is often overlooked is key to understanding how objects in JavaScript work code that doesn t belong to a function is executed when it s read by the JavaScript interpreter while code that belongs to a function is
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960&rsquo; s The term object oriented programming&rsquo; was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

ERPAdvantages for Management Functions

ERP Advantages for Management Functions ERP management systems provide a technology platform in which organizations can integrate and coordinate their main internal business processes They use this to fight against the problem of the organizational inefficiency brought on by the use of different sys
 

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 

SOA Concepts

SOA Concepts Today the concept of Service Oriented Architecture has become ubiquitous Evidence from recent years establish that SOA is not just about hype but a part of every major Business environment The truth is Service Oriented Architecture can be beneficial to Business only when it is utilized
 

C++ Virtual Functions

C Virtual Functions What are Virtual Functions Virtual as the name implies is something that exists in effect but not in reality The concept of virtual function is the same as a function but it does not really exist although it appears in needed places in a program The object oriented programming la
 

C++ Inline Functions

C Inline Functions In this C tutorial you will learn about Inline function what is inline function reason for the need of inline function what happens when an inline function is written general format of inline function explained with example mosgoogle center What is Inline Function Inline functions
 

Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape