Found 7346 Articles for C++

What is the top IDE for c++ on Window?

Fendadis John
Updated on 10-Feb-2020 12:38:12

76 Views

Big projects are difficult to manage on mere text editors. You're likely to be more productive and less frustrated if you use an IDE in such cases. There are various types of IDE's and you should select the right one which fits your needs. Here's a list of best C/C++ IDE's for Window.Visual Studio − It is an IDE developed by Microsoft. This IDE has the best in class tooling for building, developing and profiling programs of C++ on Windows. Visual Studio also has a huge plugin store with a lot of plugins. It also integrates very smoothly with other Microsoft ... Read More

Different types of operators in C++

Krantik Chavan
Updated on 26-Feb-2020 12:33:01

481 Views

There are many types of operators in C++. These can be broadly categorized as: arithmetic, relational, logical, bitwise, assignment and other operators.Arithmetic OperatorsAssume variable A holds 10 and variable B holds 20, then −OperatorDescription       +        Adds two operands. A + B will give 30-Subtracts second operand from the first. A - B will give -10*Multiplies both operands. A * B will give 200/Divides numerator by de-numerator. B / A will give 2%Modulus Operator and remainder of after an integer division. B % A will give 0++Increment operator, increases integer value by one. A++ will give ... Read More

The mutable storage class in C++

Nishtha Thakur
Updated on 10-Feb-2020 12:34:28

1K+ Views

The mutable storage class specifier is used only on a class data member to make it modifiable even though the member is part of an object declared as const. You cannot use the mutable specifier with names declared as static or const, or reference members.In the following example −class A {    public:    A() : x(4), y(5) { };    mutable int x;    int y; }; int main() {    const A var2;    var2.x = 345;    // var2.y = 2345; }the compiler would not allow the assignment var2.y = 2345 because var2 has been declared ... Read More

The extern storage class in C++

Smita Kapse
Updated on 10-Feb-2020 12:33:34

3K+ Views

The extern storage class specifier lets you declare objects that several source files can use. An extern declaration makes the described variable usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externally defined.An extern declaration can appear outside a function or at the beginning of a block. If the declaration describes a function or appears outside of a function and describes an object with external linkage, the keyword extern is optional.If a declaration for an identifier already exists at file scope, any ... Read More

The static storage class in C++

Anvi Jain
Updated on 10-Feb-2020 12:32:02

436 Views

The static storage class instructs the compiler to keep a local variable in existence during the lifetime of the program instead of creating and destroying it each time it comes into and goes out of scope. Therefore, making local variables static allows them to maintain their values between function calls.The static modifier may also be applied to global variables. When this is done, it causes that variable's scope to be restricted to the file in which it is declared.In C++, when static is used on a class data member, it causes only one copy of that member to be shared ... Read More

The register storage class in C++

Nitya Raut
Updated on 30-Jul-2019 22:30:21

290 Views

In C, the register storage class specifier indicates to the compiler that the object should be stored in a machine register. The register storage class specifier is typically specified for heavily used variables, such as a loop control variable, in the hopes of enhancing performance by minimizing access time. However, the compiler is not required to honor this request. Because of the limited size and number of registers available on most systems, few variables can actually be put in registers.In C++ it is simply an unused reserved keyword, but it's reasonable to assume that it was kept for syntactical compatibility ... Read More

The auto storage class in C++

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:21

177 Views

In C, The auto storage class specifier lets you explicitly declare a variable with automatic storage. The auto storage class is the default for variables declared inside a block. A variable x that has automatic storage is deleted when the block in which x was declared exits.You can only apply the auto storage class specifier to names of variables declared in a block or to names of function parameters. However, these names by default have automatic storage. Therefore the storage class specifier auto is usually redundant in a data declaration.It was initially carried over to C++ for syntactical compatibility only, ... Read More

How to compile and run the C++ program?

George John
Updated on 31-Aug-2023 01:59:36

144K+ Views

Once you've got your compiler and source program ready, it is very easy to compile and run a C++ program. Assuming that you've installed GCC compiler, and you have a source.cpp file that you want to compile, follow the following instructions to compile and run it. Step 1 − Open a new terminal window or cmd if you are on windows. Step 2 − Change the directory to the directory in which you have your source.cpp file. For example, if it is in C:/Users/Dell/Documents, enter your command line − $ cd 'C:/Users/Dell/Documents' Step 3 − Now enter the following command ... Read More

Getting Started with C++ in Visual Studio

Akshaya Akki
Updated on 10-Feb-2020 12:29:46

3K+ Views

This guide will help you become familiar with many of the tools and dialog boxes that you can use when you develop applications in C++ with Visual Studio. We'll create a "Hello, World" - style console application to help you learn more about working in this IDE.PrerequisitesTo follow along, you need a copy of Visual Studio 2017 version 15.3 or later, with the Desktop development with C++ workload installed. For a fast guide to installation, see Install C++ support in Visual Studio(https://docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation).Create a console appStart Visual StudioTo create a console app project, choose File > New > Project to open ... Read More

What does an auto keyword do in C++?

Vrundesha Joshi
Updated on 10-Feb-2020 12:27:39

7K+ Views

Auto was a keyword that C++ "inherited" from C that had been there nearly forever, but virtually never used. All this changed with the introduction of auto to do type deduction from the context in C++11. Before C++ 11, each data type needs to be explicitly declared at compile time, limiting the values of an expression at runtime but after a new version of C++, many keywords are included which allows a programmer to leave the type deduction to the compiler itself.With type inference capabilities, we can spend less time having to write out things compiler already knows. As all ... Read More

Advertisements