- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7346 Articles for C++
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
726 Views
In C++ we can omit the curly braces after if-else statements, or after any loop. If we do not use curly braces then only one statement after the if-else or loop will be considered under that block. For example −if(condition) { Line 1 Line 2 } if(condition) Line 1 Line 2In the first case, the Line1 and Line2 both are in the if block. But in the second condition, the Line1 is in if block but Line2 is not in if block. So we can omit curly braces only there is a single statement under if-else or ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
1K+ Views
In C++ the cin is used to take input from user. Sometimes for some reasons some error flags are set. In that time the cin does not take any input. Sometimes it takes some other characters. So if we clear the cin, then the error flags are reset. Then we can use getline(), get() etc. functions.The ignore() function is another stream input function. If we write the function like thiscin.ignore(1000, ‘’)Then it will ignore next 1000 characters, otherwise ignore lines until ‘’ is found.
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
121 Views
This is a C++ program to print only Odd Numbered Levels of a Tree.AlgorithmStructure and functions with pseudocodes:Begin Declare nod as a structure. Declare d of integer datatype. Declare a pointer l against struct nod. Declare a pointer l against struct nod. Call function struct nod* newNod(int d). Declare struct nod* newNod(int d) function. Declare a pointer node against struct node. Initialize node = (struct nod*) malloc(sizeof(struct nod)). node->d = d node->l = NULL ... Read More
![Nishtha Thakur](https://www.tutorialspoint.com/assets/profiles/13598/profile/60_104893-1512719058.jpg)
17K+ Views
In C++ we can pass arguments into a function in different ways. These different ways are −Call by ValueCall by ReferenceCall by AddressSometimes the call by address is referred to as call by reference, but they are different in C++. In call by address, we use pointer variables to send the exact memory address, but in call by reference we pass the reference variable (alias of that variable). This feature is not present in C, there we have to pass the pointer to get that effect. In this section we will see what are the advantages of call by reference ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
779 Views
In C++ thIn C++ the double quotes are used as string literals, and single quote with one character is used as character literals. Now here we will see what will be the output if we try to print a multi-character string using the single quote.Example Code Live Demo#include using namespace std; main() { cout
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
632 Views
A Binary Search Tree is a sorted binary tree in which all the nodes have following two properties −The right sub-tree of a node has a key greater than to its parent node's key.The left sub-tree of a node has a key less than or equal to its parent node's key.Each node should not have more than two children.Tree rotation is an operation that changes the structure without interfering with the order of the elements on a binary tree. It moves one node up in the tree and one node down. It is used to change the shape of the ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
440 Views
If a binary tree is traversed post-order, the left subtree is visited first, then the right sub-tree and later the root. This is a C++ Program for Post Order Tree traversal without recursion. We do the program here by using stack.AlgorithmFor postorder traversal:Begin Declare postorder_traversal(struct node*t, struct tree**top) if(t==NULL) then print “Empty Tree”. Return. Print “Postorder Data Using Stack :”. Call push(t, top) function to insert values. Declare a pointer store against tree structure. Initialize ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
2K+ Views
A Binary Search Tree is a sorted binary tree in which all the nodes have following two properties − The right sub-tree of a node has all keys greater than to its parent node's key. The left sub-tree of a node has all keys less than to its parent node's key. Each node should not have more than two children. Tree rotation is an operation that changes the structure without interfering with the order of the elements on a binary tree. It moves one node up in the tree and one node down. It is used to change the shape of the tree, ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
556 Views
If a binary tree is traversed in-order, the left subtree is visited first, then the root and later the right sub-tree. The output the key in ascending order in in_order traversal. This is a C++ Program for Inorder Tree Traversal without Recursion.AlgorithmBegin Declare a structure n. Declare d of the integer datatype. Declare a pointer l against structure n. Declare a pointer r against structure n. Declare a constructor of structure n. Pass an integer variable d to parameter. ... Read More