Learn Advanced C++ from the Best Tutors
Search in
Lesson Posted on 23/06/2017 Learn Advanced C++
Do You Know How Is Size Of Structure Defined?
Umasankar N.
Software Professional Trainer and Consultant with 26+ years of software design & development experience...
Size of the structure is defined based on multiplies of bigger data type member in the structure.
Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples of size of Integer.
The following code snippet will explain the size of Structure.
================================================
#include
struct Test1
{
int a;
char b;
int c;
};
struct Test2
{
char a;
int b;
char c;
};
struct Test3
{
char a;
char b;
int c;
};
struct Test4
{
int c;
char a;
char b;
};
int main()
{
struct Test1 t1;
printf("%d\n",sizeof(t1));
struct Test2 t2;
printf("%d\n",sizeof(t2));
struct Test3 t3;
printf("%d\n",sizeof(t3));
struct Test4 t4;
printf("%d\n",sizeof(t4));
return 0;
}
================================================
Output:
12
12
8
8
read less
Lesson Posted on 15/06/2017 Learn Advanced C++
Basic Concepts of Web Designing
Dev Group
Dev Group provides an in-depth IT & accounts training in Delhi. All the courses and training classes...
In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the web) are typically connected by phone lines, digital satellite signals, cables, and other types of data-transfer mechanisms. A ‘data-transfer mechanism’ is a nerd’s way of saying: a way to move information from point A to point B to point C and so on.
The computers that make up the web can be connected all the time (24/7), or they can be connected only periodically. The computers that are connected all the time are typically called a ‘server’. Servers are computers just like the one you’re using now to read this article, with one major difference, they have a special software installed called ‘server’ software.
Server software is created to ‘serve’ web pages and web sites. Basically, the server computer has a bunch of web sites loaded on it and it just waits for people (via web browsers) to request or ask for a particular page. When the browser requests a page the server sends it out.
The short answer is: by typing in the URL, or in other words, the web site address. So for example, if you wanted to find the web site www.devgroups.in, you would type in the address into your web browser’s address bar or maybe use your ‘favorites’ or ‘bookmarks’ link to Dev Groups.
There are other ways to find web sites (like search engines,) but behind the scenes web sites are all being found by going to the web site’s official address. That brings us our last nerd detail: how does a website get an official address so that the rest of the web can find it?
If you ever wondered what the heck registering a domain was all about … you probably figured it out by now! But just in case – registering a domain name gets you an official address for your web site on the World Wide Web. With this ‘official’ address, the rest of the web can find you.
Like your home address is unique in the real world, there also can’t be any duplicate addresses on the Internet, otherwise no one would know where to go! In other words, domain names are unique addresses on the web.
Lesson Posted on 13/06/2017 Learn Advanced C++
Umasankar N.
Software Professional Trainer and Consultant with 26+ years of software design & development experience...
Array | Linked List |
Accessing element is easy. | Accessing element is difficult compare to Array. |
Easy to use. | Difficult to use. |
Memory is Fixed size. | Memory is variable size. |
If all the memories are not utilised, unused memory will be present. | Memory will be allocated as much as required. No unused memory available. |
As there is no pointer variable, no extra memory is required. | Extra bytes of memory is required for Pointer varialble. |
Memory will be available contiguously. | Memory will be scattered. |
In case of bigger array, large chunks of contiguous memory block is required. | Multiple small chunks of memory block is enough. |
Inserting / Deleting / Modifying an element is very easy. | Inserting / Deleting / Modifying an element is difficult. |
read less
Learn Advanced C++ from the Best Tutors
Lesson Posted on 06/06/2017 Learn Advanced C++
Set 0 To Kth Bit In A Variable
Umasankar N.
Software Professional Trainer and Consultant with 26+ years of software design & development experience...
The following code snippet Set 0 to Kth Bit in an variable
#include
int UnsetBitValue(int n, int k);
int main()
{
printf("%d\n\n",UnsetBitValue(255,6));
return 0;
}
// Set kth bit to zero
int UnsetBitValue(int n, int k)
{
n &= ~ (1 << (k - 1));
return n;
}
Answered on 27/05/2017 Learn Advanced C++
Sheeja
Smart Computer Tutor
Lesson Posted on 13/05/2017 Learn Advanced C++
Introduction to Programming Languages
Clevigour Solutions
Clevigour Solutions is an IT solutions company Founded in 2015. Clevigour solutions is organised by young...
What is a Programming Language?
A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine.
Types of programming Languages
There are two types of low level languages
-An assembly language is a low-level programming language for microprocessors and other programmable devices.
-Assembly language implements a symbolic representation of the machine code needed to program a given CPU architecture.
-Assembly language is a mathematical and logical symbol that used to communicate to the computer.
High-level language is a computer programming language that is designed for a specific job, and is easier to understand. Its source code is written in human understandable language. However, for a computer to understand and run a program created with a high-level language, it must be compiled into machine language.
Ex: FORTRAN, ALGO, LISP, COBOL, C, C++, JAVA
FORTRAN-->The first important algorithmic language was FORTRAN (formula translation), designed in 1957 by an IBM team led by John Backus. It was intended for scientific computations with real numbers and collections of them organized as one- or multidimensional arrays. Its control structures included conditional IF statements, repetitive loops (so-called DO loops), and a GOTO statement that allowed non sequential execution of program code.
ALGOL-->ALGOL (algorithmic language) was designed by a committee of American and European computer scientists during 1958–60 for publishing algorithms, as well as for doing computations. Like LISP (described in the next section), ALGOL had recursive subprograms—procedures that could invoke themselves to solve a problem by reducing it to a smaller problem of the same kind. ALGOL introduced block structure, in which a program is composed of blocks that might contain both data and instructions and have the same structure as an entire program. Block structure became a powerful tool for building large programs out of small components.
LISP-->LISP (list processing) was developed about 1960 by John McCarthy at the Massachusetts Institute of Technology (MIT) and was founded on the mathematical theory of recursive functions (in which a function appears in its own definition). A LISP program is a function applied to data, rather than being a sequence of procedural steps as in FORTRAN and ALGOL. LISP uses a very simple notation in which operations and their operands are given in a parenthesized list. LISP became a common language for artificial intelligence (AI) programming, partly owing to the confluence of LISP and AI work at MIT and partly because AI programs capable of “learning” could be written in LISP as self-modifying programs.
C Language--->The C programming language was developed in 1972 by Dennis Ritchie and Brian Kernighan at the AT&T Corporation for programming computer operating systems. Its capacity to structure data and programs through the composition of smaller units is comparable to that of ALGOL. It uses a compact notation and provides the programmer with the ability to operate with the addresses of data as well as with their values. This ability is important in systems programming, and C shares with assembly language the power to exploit all the features of a computer’s internal architecture.
Business-oriented languages
COBOL-->COBOL (common business oriented language) has been heavily used by businesses since its inception in 1959.COBOL uses an English-like notation—novel when introduced. Business computations organize and manipulate large quantities of data, and COBOL introduced the record data structure for such tasks. A record clusters heterogeneous data such as a name, ID number, age, and address into a single unit. This contrasts with scientific languages, in which homogeneous arrays of numbers are common. Records are an important example of “chunking” data into a single object, and they appear in nearly all modern languages.
What is Structure Procedure Programming?
- In the early time the Structure Procedure programming was widely used designing and developing software.
-Structure procedure programming is a programming paradigm (pattern of something) or a technique for design and development of software in which the complex program is divided into small unit called function or subroutines also called procedure so that the complexity of program can be reduce and the code can be reuse. But later this approach was found unsuitable for more complex software. Because the function and variable was stored separately and there is no technique to hiding data.
- In this technique the softer maintenance was complex and security was weak. It was not suitable for more complex software. So a new approach come called object oriented programming.
What is Object oriented Programming?
- Object oriented programming is an approach or technique design and development of software based on the following idea
- Encapsulation, abstraction, inheritance, data hiding, polymorphism.
- In object oriented programming the object is the basic unit of object oriented programming. Designing the object oriented model involving defining set of classes. A class is a template from which object are created.
- In object oriented programming the object state (data) and behavior (function) are encapsulate within in class. The message passing ensures that it can be accessible if it is permitted. It prevents unauthorized access. Evaluation of OOP
- The OOP (Object Oriented Programming) approach is most commonly used approach now a day. OOP is being used for designing large and complex applications. Before OOP many programming approaches existed which had many drawbacks.
- These programming approaches have been passing through revolutionary phases just like computer hardware. Initially for designing small and simple programs, the machine language was used. Next come the Assembly Language which was used for designing larger programs. Both machine and Assembly languages is machine dependent. Next come Procedural Programming Approach which enabled us to write larger and hundred lines of code. Then in 1970, a new programming approach called Structured Programming Approach was developed for designing medium sized programs. In 1980's the size of programs kept increasing so a new approach known as OOP was invented.
Note: Programming paradigms are a way to classify programming languages according to the style of computer programming.
Object oriented Paradigm
-Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. A feature of objects is that an object's procedures can access and often modify the data fields of the object with which they are associated (objects have a notion of "this" or "self"). In OOP, computer programs are designed by making them out of objects that interact with one another.
- OOP is a better way of solving computer problems compared to a procedural programming language such as C. OOP uses classes which contain members (variables) and methods (functions). OOP uses a modular type of programming structure.
- OOP is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.
- One of the main advantages of object-oriented programming over procedural programming is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features for existing objects. This makes object-oriented programs easier to modify.
Advantage of oop
The main advantage or merits or benefit are given below
- Oop provide better syntax structure, modeling real world is easy and flexible.
- Complex software system can be modularize on the basic of class and object
- Creation and maintenance is easy hence reduce software development time.
- Data encapsulation and data hiding increase software reliability and modifiability.
- Polymorphism and dynamic binding increase flexibility of code.
- Inheritance allows software code to extensible and reuse
Disadvantage of oop
The main disadvantage or demerits or drawback are given below
- Oop decompose large hierarchy of classes is complex and difficulty toi maintain
- Polymorphism and dynamic binding also required long processing, due to the overhead of function calls during the runtime.
- Oop software and debugging and testing tools are not standardized.
- For small application oop is not suite.
Comparison of structure procedural programming (SPP) and OOP
Characteristics | SPP | oop |
Program modularization | On the basis of function | On the basis of class and object |
Design Approach | Top-down | Bottom-up |
Data | Move openly around the system from function to function | Data is mostly hidden Or permits restricted access public private protected |
Problem emphasis | Represented by logical entities and control flow | Represented more closely with interacting Object and class. |
Uses of abstraction | Procedural abstraction | Class and object abstraction |
read less
Learn Advanced C++ from the Best Tutors
Lesson Posted on 02/12/2016 Learn Advanced C++
Dr. Lalit Arora
- Teaching from Last 20 years in computer Field. - Published few textbooks on object oriented Programming.
The computers we see today, were not always the same. By computers, means anything that is able or helpful in computing. Early computers were mechanical calculators, punching machines etc. Then came ENIAC etc. that digitally computed but were too big. The usage of personal computers started as a hobby among a certain set of people and went on to become something that people cannot live without. Let’s take a look at the journey of a computer from a mechanical abacus to present day ultra fast computers.
The First Computer
Around 3000 B.C. The Mesopotamians unknowingly laid the foundation of computer era. They invented the earliest form of Bead-&-Wire counting machine known as Abacus. The Chinese improved above the Abacus so that they can calculate fast.
The Chinese further improved on the above abacus so that calculations could be done more easily. Even today abacus is considered as an apt tool for young children to do calculations.
Napier’s Logs and Bones
John Napier (1550-1617) developed the idea of logarithms. He used logs to transform multiplication problem to addition problem. Napier’s logs later became the basis for a well-known invention, The Computation Machine Known as Slide-Rule (Invented in 1662) Napier also devices set of numbering rods known as ‘Napier’s Bones’. He could perform both multiplication and division using these ‘Bones’.
Pascal’s adding Machine
Blaise Pascal, a French Mathematician, invented a Machine in 1662 made up of gears which was used for adding numbers quickly. This machine was known as Adding Machine (also known as Pascaline) and was capable of addition and subtraction. In worked on clockwork mechanism principle. The Adding Machine consisted of numerous toothed wheels having unique position value. The rotation wheels controlled the Addition and Subtraction operation. This Machine was capable carry-transfer automatically.
Leibnitz Calculator
Gottfried Leibnitz a German Mathematician, improved the adding Machine and constructed a new machine in 1671 that was able to perform multiplication and division as well. This Machine performed multiplication through repeated addition of numbers. Leibnitz’s machine used stepped cylinder each with nine teeth of varying lengths instead of wheels as was used by Pascal.
Jacquard’s Loom
Joseph Jacquard manufactured punched cards at the end of American Revolution and used them to control looms in 1801. Thus the entire control weaving process was automatic. The entire operation was under a program’s control. With the historic invention of punched cards, the era of Storing and Retrieving information started that greatly influenced the later invention and advancements.
Babbage’s Difference Engine
Charles Babbage, a professor of mathematics, developed a machine called Difference engine in the year 1882. This machine was expected to calculate logarithmic tables to high degree of precision. The difference engine was made to calculate various mathematical functions. The machine was capable of polynomial evolution by finite difference and its operation was automatic multi stop operation.
Babbage’s Analytical Engine
In 1833, Charles Babbage started designing an analytical engine which was to become a real ancestor of modern day computer. With the methodical design of his analytical engine, Babbage meticulously established the basic principles on which today’s computer work. The Analytical Engine was capable to perform all four arithmetic operation as well as comparison, it had a number of features starting to those which are in today’s computer. He included the concept of central processor, Memory, Storage Area and Input/output Devices in his design. The Two revolutionary innovation incorporated in analytical Engine where comparisons and modifications of stored information. The first innovation enabled the machine to compare quantities and then decide which of the Instruction sequence to be followed. The second permitted the result of calculation to change numbers and instructions already stored in machine. Owing to the lack of technology of the time, the Analytical engine was never built. Its Design remained conceptual. His great inventions of Difference Engine and Analytical Engine earned Charles Babbage the title “FATHER OF MODERN COMPUTERS”-a fitting Tribute to him.
MARK-I
Professor Howard Aiken (1900-1973) in U.S constructed in 1943 an electromechanical computer named “MARK-I” which could multiply two 10 digit numbers in 5 second-a record at that time. MARK-I was the first machine which could perform according to pre-programed instructions automatically without any manual interface. This was the first operational general purpose computer.
read lessAnswered on 23/12/2016 Learn Advanced C++
Das K
Android Wizard
Answered on 12/10/2016 Learn Advanced C++
Umasankar N.
Software Professional Trainer with 26+ years of Experience in Software Design and Development
Learn Advanced C++ from the Best Tutors
Lesson Posted on 19/09/2016 Learn Advanced C++
C and C++ programming with memory level debugging
Umasankar N.
Software Professional Trainer and Consultant with 26+ years of software design & development experience...
Understanding C and C++ programming by using memory level debugging.
Step 1: Understand the Memory map of C executable
Step 2: Start memory level debugging using popular IDE
Step 3: Find the memory changes in each step
If you are understand the above step thoroughly you are able to do Coding any complex C and C++ programming and able to understand others C and C++ code also.
read less
UrbanPro.com helps you to connect with the best Advanced C++ in India. Post Your Requirement today and get connected.
Ask a Question
The best tutors for Advanced C++ Classes are on UrbanPro
The best Tutors for Advanced C++ Classes are on UrbanPro