GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Concepts
Go To First  |  Previous Question  |  Next Question 
 Concepts  |  Question 5 of 24    Print  
How to write a class in c++ using only one object?

  
Total Answers and Comments: 2 Last Update: December 08, 2006     Asked by: rakesh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 22, 2006 01:14:42   #1  
priyadarshani        

RE: how to write a class in c++ using only one object?...
class singleten{ static int count; singleten() { if (count 1) { exit(0); } count++; }}singleten::count 0;void main(){singleten s1;singleten s2;}program is terminated as soon as second object is created.
 
Is this answer useful? Yes | No
December 08, 2006 01:12:30   #2  
kalayama Member Since: September 2006   Contribution: 501    

RE: How to write a class in c++ using only one object?...
Was that answer to the question.The question was Writ a class using one object . Doesn't mean that the the class can have only one object ain't it?
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : A database is an organized collection of information.  It is structured so you can jump to the information by using a key, and find related infromation by navigating a path.  A sequential (flat)  file is not considered a database.  ...
Read Answers (2) | Asked by : Sandeep
Tags : RDBMS

Latest Answer : #includevoid main(){int i;char temp;char str[9] = "Computer";int length;length = strlen(str1)-1;printf("The length of the String is: %dn",length);for(i=0;i

Latest Answer : Was that answer to the question.The question was "Writ a class using one object". Doesn't mean that the the class can have only one object ain't it? ...
Read Answers (2) | Asked by : rakesh


 Sponsored Links

 
Related Articles

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

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
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

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
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

JavaScript Date Object

JavaScript Date Object In this JavaScript tutorial you will learn about date object and methods of date object explained along with syntax and example mosgoogle center JavaScript Date Object Usage of Date Object Date object of Java Script is used to work with date and times General syntax for defini
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape