Found 7346 Articles for C++

How to start object-oriented programming in C++?

Arjun Thakur
Updated on 02-Mar-2020 08:09:42

618 Views

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of attributes; and instructions to do things, in the form of methods.For example, a person is an object which has certain properties such as height, gender, age, etc. It also has certain methods such as move, talk, and so on.ObjectThis is the basic unit of object oriented programming. That is both data and function that operate on data are bundled as a unit called as object.ClassWhen you define a class, you define a blueprint for an object. This doesn't actually ... Read More

What is the use of the '&' symbol in C++?

Sravani S
Updated on 07-Nov-2023 20:29:43

27K+ Views

The & symbol is used as an operator in C++. It is used in 2 different places, one as a bitwise and operator and one as a pointer address of operator.Bitwise ANDThe bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. If both bits are 1, the bit is set to 1. Otherwise, the bit is set to 0. Both operands to the bitwise AND operator must be of integral types. Example #include   using namespace std;   int main() {      unsigned short a = 0x5555;      // pattern 0101 ...      unsigned short b = 0xAAAA;      // pattern 1010 ...      cout

What are undefined reference/unresolved external symbol errors in C++?

Daniol Thomas
Updated on 23-Jun-2020 13:26:30

1K+ Views

As the name suggests, a symbol you declared was not defined by you. This may occur due to many cases. Let's have a look at three of them −You forgot to define the declared name. For example, you declared a function in a file and used it somewhere. But you did not provide its definition. Code −#include void foo(); int main() {    foo(); // Declared but not defined }You defined it but did not use the qualified name. Say you created a class with a method and defined that method but forgot using scope resolution to link that function ... Read More

What are the best online tutorials for C++?

V Jyothi
Updated on 23-Jun-2020 13:25:11

136 Views

There are many resources on the web that can help you learn C++. I've tried to give you a compiled list of some of the best resources out there to learn C++ −http://www.tutorialspoint.com/cplusplus/ − This is a great place to learn C++ as it covers almost all basic and intermediate topics in C++ in-depth and is overall a great resource to learn C++. A Tour of C++ (Bjarne Stroustrup) − This book is a quick overview of C++ (language and standard library, and using C++11) at a high level for people who already know C++. This is a good book for ... Read More

What are the best C++ Books and Guides?

Krantik Chavan
Updated on 23-Jun-2020 13:28:34

98 Views

There are many resources on the web that can help you learn C++. I've tried to give you a compiled list of some of the best resources out there to learn C++ −http://www.tutorialspoint.com/cplusplus/ − This is a great place to learn C++ as it covers almost all basic and intermediate topics in C++ in depth and is overall a great resource to learn C++.A Tour of C++ (Bjarne Stroustrup) − This book is a quick overview of C++ (language and standard library, and using C++11) at a high level for people who already know C++. This is a good book ... Read More

C++11 Features Supported by Intel

Priya Pallavi
Updated on 30-Jul-2019 22:30:21

108 Views

The C++11 features supported by Intel are available as an official guide in their docs. You can check these features out on https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler.

Difference between static, auto, global and local variable in C++

George John
Updated on 30-Jul-2019 22:30:21

3K+ Views

There are two separate concepts here − scope, which determines where a name can be accessed - global and local storage duration, which determines when a variable is created and destroyed - static and auto Scope Local variables can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own. Example Live Demo #include using namespace std; int main () { // Local variable declaration: int a, b; int c; // actual initialization a = 10; b = 20; c = a + b; cout

What are local variables and global variables in C++?

Samual Sam
Updated on 11-Feb-2020 09:59:43

8K+ Views

A scope is a region of the program and broadly speaking there are three places, where variables can be declared − Inside a function or a block which is called local variables,  In the definition of function parameters which is called formal parameters. Outside of all functions which are called global variables.Local variables can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own. Example#include using namespace std; int main () {    // Local variable declaration:    int a, b;    int c;    // actual ... Read More

What are global variables in C++?

Lakshmi Srinivas
Updated on 11-Feb-2020 09:57:02

7K+ Views

Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the lifetime of your program.A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration. Example#include using namespace std; // Global variable declaration: int g; int main () {    // Local variable declaration:    int a, b;    a = 10;    b = 20;    g = a + b;    cout

What are local variables in C++?

karthikeya Boyini
Updated on 11-Feb-2020 09:55:53

315 Views

Variables that are declared inside a function or block are local variables. They can be used only by statements that are inside that function or block of code. Local variables are not known to functions on their own.ExampleLive Demo#include using namespace std; int main () {    int a, b;    int c;    a = 10;    b = 20;    c = a + b;    cout

Advertisements