Basic C,C++ Interview Questions and Answers

1. What is the difference between class and structure?

Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public.

Class: Class is a successor of Structure. By default all the members inside the class are private.

One more difference apart from public and private access specifier, that struct don’t have protected as an access specifier while class do.

2. What is the difference between an object and a class?

Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.

A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don’t change.

The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.

An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed.Also during that lifetime, the attributes of the object may undergo significant change.

3. What is encapsulation?

Encapsulation means wrapping up of Data and Code…this is what i got from data structures book.

4. What is an enumerator?

Enumeration is a value data type, which means that enumeration contains its own values and cannot inherit or pass inheritance. Enumerator allows you to assign symbolic names or integral constants.

5.  What is the difference between c & c++?

There are many differences between c and c++ but some of the important are

1.A small but potentially important difference between c and c++ is that in c a character constant is automatically elevated to and integer whereas in c++ it is not.

2.In c we can declare the global variable several times eventhough it is a bad programming concept but in c++ it is an error.

3.Another subtle difference between c and c++ is that in c++ all functions must be prototyped.Remember in c prototypes are recommended but technically optional.

For more knowledge on computer languages Click here

  • Share/Bookmark

The Facebook Story

Facebook Story :-

Few Words by Facebook CEO : - Mark Zuckerberg.

A chronicle of the founding of Facebook, the social-networking Web site.

Watch out the Movie : The Social Network

This Movie is an awesome production ,which boost up anybody to build a thing which can change the world.

  • Share/Bookmark

Kent Tap Gaurd (Water Purifier)

Now Brush Your Teeth & Wash Fruits & Vegetables With Bacteria – Free Safe Water

Features

  • High grade granular activated carbon, a powerful de – chlorination agent, removes residual chlorine and the unpleasant odour from your tap water
  • Advanced multi – layered hollow fiber UF membrane filter removes Rust, Bacteria, Cyst, Colifom Bacilli, Micro – organisms & Microscopic impurities from water
  • See through window, to check contamination build up and find out when it’s time to replace the cartridge
  • Long life membrane lasting upto 1500 litres
  • Facility to backwash the membrane which increases the life of filter cartridge
  • Easy availability of genuine filter cartridge and spare parts
  • Provided with accessories to fit on various types of taps
  • Easy to use 3 – mode water selection lever to provide a choice of Purified Water, Unfiltered Straight or Unfiltered Spray to suit your needs.

Applications

  • Best for washbasins – To brush your teeth, gargle or splash your face and eyes with germ – free and odour free water
  • Excellent choice for kitchen sinks – To wash fruits, vegetables, meat and sea food with bacteria and cyst – free water
  • Share/Bookmark

Windows 7 Hang Problem :”":

Is your Windows 7 is hanging?  If it is, then there are a couple of different reasons why this could be.  I’m going to go over the #1 most common reason as to why Windows 7 is hanging, and the steps you can take to get it working like new again.  Let’s get into it and fix your operating system.

Why Windows 7 Is Hanging

The most common reason as to why Windows hangs is that there is something wrong with the registry.  The Windows registry is a piece of the operating system that records and has a lot of the important information that programs use to run correctly.  Settings, attributes, and important details that are used in functions and programs.  If something is incorrect in there then it will drastically slow down the program, as it will be searching for a file in a certain location, and maybe won’t find it or will find something that can cause an error.

How to Clean Your Registry

There are numerous step by step guides on the internet that show you how you can clean the registry yourself, but I don’t recommend that you do this.  For the most part, unless you know exactly what you’re doing, you should stay clear of this area of the Windows operating system.  One or two wrong moves and you can mess things up even more – and maybe have to reinstall Windows 7 altogether.

Use A Registry Cleaner Instead (Safer, Better)

The safest, and best, option is to use a registry cleaner that you can download, scan, and fix the errors with.  Most of them you can download and use within a couple of minutes.  Be careful of which one you get though, a lot have viruses and are just bugs “posing” as registry cleaners – so make sure they are credible!

This Is What A Registry Cleaner Can Do For You:

* Optimizes Your PC
* Fixes Invalid, Corrupt Or Error Files.
* Adds Missing Files.
* Fixes Registry Errors.
* It’s 100% Automatic.
* And It Has Lots Of more Features.

Why don’t you take a look at this software program? Visit: Best Registry Cleaners

To save you a bit of time, download this registry tool.  It’s the best one I’ve found online and it really speeds up your computer by doing a full clean and fix of the registry.  I’m pretty sure this will wipe out whatever reason your Windows 7 is hanging.  Good luck!

  • Share/Bookmark

Play Online Bollywood,Devotional,Latest Movie Songs

A source of Unlimited Music & Entertainment

Visit   @   MusicIndiaOnline.com

  • Share/Bookmark

Cricket-Kevin O’Brien hits fastest World Cup century(Ireland))

World Cup 2011 :- Kevin O’Brien (Ireland) hits fastest World Cup century !!

Ireland’s Kevin O’Brien smashed the fastest Cricket World Cup century in 50 balls against England in Group B on Wednesday. The previous best was Australian Matthew Hayden who took 66 balls to achieve three figures in 2007 against South Africa. O’Brien hit six sixes and 13 fours in his amazing innings as Ireland responded to England’s 327-8.

World Cup 2011

  • Share/Bookmark
Get Adobe Flash playerPlugin by wpburn.com wordpress themes