Posts

Objects and Classes

Objects and Classes IMPORTANT QUETIONS FOR EXAM (GTU,CVM,SP) CHAPTER ONE COMPLETE HERE IS YOUR CVMU SYLLABUS - LINK   BLOG BY JAY SHAH( GMAIL ) Explain basic concept of class.  A class is a template that specifies the attributes and behavior of things or objects.  A class is a blueprint or prototype from which objects are created.  A class is the implementation of an abstract data type (ADT).  It defines attributes and methods. Object declaration:  In following example class employee is created and ‘a’ is object of this class. class item { // data members and member functions }a;  In above syntax class name is item, and a is object of that class  Object declaration can be also done in main() function as follows: int main() { item a; } Accessing class member:  Private members of the class can only accessed by the members with in that class.  Public members of the class can be accessed outside the class also.  For accessing class member outside class can be done by using do...

C++ FUNTIONS

                                                          CHAPTER 3 (C++ FUNTIONS) IMPORTANT QUETIONS FOR EXAM (GTU,CVM,SP) CHAPTER THREE COMPLETE HERE IS YOUR CVMU SYLLABUS - Link  BLOG BY JAY SHAH( GMAIL ) Explain Call by Value and Call by Reference with appropriate examples.  OR Write a program to interchange (swap) the value of two variables. Call By Value  In call by value, the value of the variable is passed during the function call.  And copy this value in another variable at function definition.  In call by value the original value in the calling function will never change after execution of the function. Example: #include<iostream> using namespace std; void swp(int a, int b) { int temp=a; a=b; b=temp; } int main() { int x,y; cout<<"enter value of a and b:"; cin>>x>>y; swp(x,y); cout<<”\nafter ...

C++ BASICS

CHAPTER 2 (C++ BASICS) IMPORTANT QUETIONS FOR EXAM (GTU,CVM,SP) CHAPTER TWO COMPLETE HERE IS YOUR CVMU SYLLABUS - Link  BLOG BY JAY SHAH( GMAIL )  What is C++? Explain the Structure of the C++ Program  C++ is an object-oriented programming language.  It is a superset of C language and also called an extended version of C language.  It was developed by Bjarne Stroustrup at AT&T Bell lab in New Jersey, the USA in the early 1980s.  Structure of the C++ program is as follows. Include Files Class Declaration or Definition Member functions definitions Main function  In any program first write header files like iostream. h, conio.h, etc..as per the requirement of the program.  After header file write class declaration or definition as per your planning.  After class, define all member functions which are not defined but declared inside the class.  In the last write main function without main function program execution is not possible. Example: #include <iostream> //...