Tuesday, 9 February 2016

C++ Placement Questions and Answers

C++ Placement Questions and Answers
1.A property which is not true for a classes
a).are removed from memory when not in use
b).permit data to be hidden from other classes.
c).bring together all aspects of an entity in one place.
d).Can closely model objects in the real world.

2.Which of the following cannot be legitimately passed to a function in c++.
a)constant           b)variable           c)structure             d)header file.

3.this pointer is
a)implicitly points to an object                                   b)can be explicitly used in a class.
c)can be used to return an object                               d)All of the above.
e)All of the above

3.To perform I/O stream with disk files in C++, you should
a)open and close files as in procedural languages.
b)use classes derived from ios.
c)use C language library functions to read and write data.
d)include the IOSTREAM.H header file.

4.RunTime Polymorphism is achieved in C++ by using______
a)friend function   b)virtual function   c)operator overloading   d)function overloading

5.In C++ dynamic binding the code matching the object under current reference will be called at.
a)Compile time          b)Run time           c)Editing time            d)Binding time

6.Following are the object oriented programming language
a)JAVA               b)C++                c)Small talk               d)All of above

7.How many characters are recognized by ANSI C++?
a)32           b)64               c)no limit               d).none of these

8.Inheritance is the process of
a).Object of one class acquires the properties of objects of another class
b).Variable of one class acquires the properties of variable of another class
c).Object of one class acquires the properties of objects of same class
d).Variable of one class acquires the properties of objects of another class

9.By default Class members are
a)Public                b)Private              c)Protected               d)nherited

10.How many words can be read by cin?
a)one                   b)Two              c)Three                d)Four

C++   Placement Questions and Answers

11.A function that is called automatically when an object is created is called as
a)constant               b)constructor             c)static            d)friend

12.The null character will take space of
a)0 byte                  b)2 byte               c)1 byte                d)8 byte

13.This operator is used to allocate memory dynamically
a)new                b)delete             c)static                  d)real

14.Which one is correct to declare an interface in a class?
a).By making all the methods pure virtual in a class
b).By making all the methods abstract using the keyword abstract in a class
c).By declaring the class as interface with the keyword interface
d).It is not possible to create interface class in C++

15.Keywords support dynamic method of resolution is
a)abstract                   b).Virtual               c)Dynamic              d)Typeid

16.Which pointer is implicit pointer passed as the first argument for non-static member functionsin C++?
a)self pointer          b)std::auto_ptr pointer                  c).Myself pointer              d)this pointer

17.Inventor of C++ language is
a)John Dell                 b)Bjarne Stroustrup                 c)Thomusn Steve             d)Karl Thomus

18.Destructor can have following number of argument
a)2            b)1                 c)0                 d)any no of arguments

19.How does code-bloating occur in C++?
ANSWER:-        Improper use of Inline functions and templates may lead to code bloating. Multiple Inheritance may also lead to code bloating


20.Explain  about a.) Function overloading b.) Operator overloading
Function overloading:
The capability of C++ to define several functions of the same name with different sets of parameters is called function overloading. While calling an overloaded function, the C++ compiler selects the proper function by examining the number, types and order of the arguments.
Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types.
Operator overloading:
When the existing C++ operators are redefined to work on objects of user-defined classes, it is called operator overloading.
Overloaded operators form a pleasant facade which improve the understandability and reduce maintenance costs without adding anything fundamental to the language.

Sunday, 7 February 2016

Introduction To Single Linked List

Introduction To Single Linked List

Description 

  • In a single-linked list every element contains some data and a link to the next element(link), which allows to keep the structure.
  • In this type of Linked List two successive nodes are linked together in linear fashion.
  • Each element of the list is called a “node”.
  • First node is called “head” and it’s a dedicated node. By knowing it, we can access every other node in the list. 
  • Last node of the list is called “Tail”,By knowing it we can perform add operation.
  • Each Node contain address of the next node to be followed.
  • In Single Linked List only Linear or Forward Sequential  movement(traversal) is possible.
  • Elements are accessed sequentially, no direct access is allowed.

Structure of single linked list

  • Every node of a singly-linked list contains following information
    • A value (primitive data/user define data).
    • A link to the next element (pointer data).
  • Sketchy, it can be shown like this…
slink structure
Example 1:   primitive data type single lined list
                             struct single_link_list
                               {
                                        int data;
                                        struct slink*next;
                                };
Example 2:   User define data type single lined list
                              struct emp
                                {
                                         int id;
                                         char name[36];
                                          int sal;
                                 };
                                 struct single_link_list
                                 {
                                       struct emp data;
                                       struct slink*next;
                                   };

Single linked list Internal representation

  • In Singly-linked list implementation First node called head and no other node points to it.
  • Link to the head is usually stored its data and information of next data structure(Next link). For empty list, head initial value is set to “NULL”.
  • in Single linked list Last node called “Tail” usually stored its data and Next link data value is set to “NULL” because it is terminal node.
  • Below you can see another picture, which shows the whole singly-linked list internal representation..
single linked list structure_image2

 Operations on Single Linked List

  • Adding node
  • Inserting  node
  • node Count
  • Traversal
  • Deletion node
  • Updating node data

Sunday, 24 January 2016

Sanam Re full HD Video Songs Download



 SANAM RE - TRAILER



 SANAM RE TITLE SONG





 GAZAB KA HAI YEH DIN




 HUA HAIN AAJ PEHLI BAAR





 HUMNE PEE RAKHI HAI








Friday, 11 December 2015

CPP Interview Questions and Answers

CPP Interview Questions and Answers

1. Explain about Copy Constructor.
It is a constructore which initializes it’s object member variable with another object of the same class. If you don’t implement a copy constructor in your class, the compiler automatically does it.
2. When do you call copy constructors?
Copy constructors are called in these situations:
a)when compiler generates a temporary object
b)when a function returns an object of that class by value
c)when the object of that class is passed by value as an argument to a function
d)when you construct an object based on another object of the same class
3. Name the implicit member functions of a class.
a) default ctor      b) copy ctor     c) assignment operator      d) default destructor  e) address operator
4. Explain storage qualifiers in C++ programming.
a) const: This variable means that if the memory is initialised once, it should not be altered by a program.
b) volatile: This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents.
c) mutable: This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is constant.
5. Explain about dangling pointer in c++.
When the address of an object is used after its lifetime is over, dangling pointer comes into existence. Some examples of such situations are: Returning the addresses of the automatic variables from a function or using the address of the memory block after it is freed.
6. In what situations do you have to use initialization list rather than assignment in constructors.
When you want to use non-static const data members and reference data members you should use initialization list to initialize them.
7. When does a class need a virtual destructor?
If your class has at least one virtual function, you should have a virtual destructor. This allows you to delete a dynamic object through a baller to a base class object. In absence of this, the wrong destructor will be invoked during deletion of the dynamic object.
8. What is the type of “this” pointer? When does it get created?
It is a constant pointer type. It gets created when a non-static member function of a class is called.
9. How would you differentiate between a pre and post increment operators while overloading?
Mentioning the keyword int as the second parameter in the post increment form of the operator++() helps distinguish between the two forms.
10. What is a pdb file?
A program database  file contains debugging and project state information that allows incremental linking of a Debug configuration of the program. This file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug.

C++ Interview Questions and Answers

11. You run a shell on UNIX system. How would you tell which shell are you running?
To check this you can simply do the Echo $RANDOM. The results will be:
a) Undefined variable if you are from the C-Shell
b) A return prompt if you are from the Bourne shell
c) A 5 digit random number if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.
12.What are Stacks? Give an example where is is useful.
A Stack is a linear structure in which insertions and deletions are always made at one end i.e the top – this is termed as last in, first out (LIFO). Stacks are useful when we need to check some syntex errors like missing parentheses.
13. Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
An external iterator is implemented as a separate class that can be “attach” to the object that has items to step through while an internal iterator is implemented with member functions of the class that has items to step through. With an external iterator many different iterators can be active simultaneously on the same object – this is its basic advantage.
14. Do you think the following code is correct? If not, what is the problem?
T *p = 0;
delete p;        No, the code has a problem. The program will crash in an attempt to delete a null pointer.
15. In a function declaration, what does extern mean?
The extern here tells the compiler about the existence of a variable or a function, even though the compiler hasn’t yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file.
16. You want to link a C++ program to C functions. How would you do it?
This can be done by using the extern “C” linkage specification around the C function declarations.
17. Exlpain about STL(stranded template library).
STL stands for Standard Template Library. It is a library of container templates approved by the ANSI committee for inclusion in the standard C++ specification.
18. What are the different types of STL containers in C++?
Following are the 3 types of STL containers:
1. Adaptive containers – for e.g. queue, stack
2. Associative containers – for e.g. set, map
3. Sequence containers – for e.g. vector, deque
19. Explain Stack unwinding in C++
Stack unwinding is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught.
20. How would you find out if a linked-list is a cycle or not?
We can find out if the linked-list is not a cycle by using two pointers. One of them goes 2 nodes every time while the second one goes at 1 node each time. If there is a cycle, the one that goes 2 nodes each time will meet the one that goes slower. If this happens, you can say that the linked-list is a cycle else not.

Tuesday, 8 December 2015

Pen drive show empty even when data exists [Solved/Closed]

Pen drive show empty even when data exists [Solved/Closed]

Hello, 

Try this 1 

Check if the files are not in hidden mode. 

Click on "Start" -->Run --> Type cmd and press Enter. 

Here I assume your pendrive drive letter as G: 

Enter this command. 

attrib -h -r -s /s /d g:\*.* --> Press Enter 

You can copy the above command --> Right-click in the Command Prompt and 

paste it. 

Note : Replace the letter g with your pen drive letter. 

Now check your pen drive for the files. 

Good Luck