Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 3220 of 3366
4K+ Views
There are several alternatives for compiling C++ on Linux. Let's look at 2 of them −GCCAlmost all Linux distros come with GCC installed. Check whether GCC is installed on your system by entering the following command from the command line −$ g++ -vIf you have installed GCC, then it should print a message such as the following −Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr ....... Thread model: posix gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)If GCC is not installed, then you will have to install it yourself using the detailed instructions available at https://gcc.gnu.org/install/. clangClang is a compiler developed ... Read More
331 Views
Step 0 − Install MinGW GCC or Cygwin GCCTo use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but has fewer features.MinGW GCC − To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program which should be named MinGW-.exe.While installing MinGW, at a minimum, you must install gcc-core, gcc-g++, Binutils, and the MinGW runtime, but you ... Read More
882 Views
In C++, character literals are the constant values, which are assigned to variables of the character data type. These values are represented by a character enclosed within single quotation marks. There are mainly five types of character literals: Narrow-character literals Wide-character literals. UTF-8 character literals UTF-16 character literals UTF-32 character literals Narrow-character Literals These character literals are of type char, which represents single-byte character. It stores characters from the ASCII table, which includes values ranging from 0 to ... Read More
489 Views
Boolean Literals In C++, Boolean literals are the values, which are assigned to variables of the Boolean data type. A Boolean literal represents two values: true or false, which are internally represented as 1 and 0 respectively. A Boolean literal occupies 1 byte (8 bits) of memory and is used for conditions, flags and logical checks. Declaring Boolean Variables You can declare the boolean variables and assign the boolean literals to them by the given following. In this variable1 and variable2 is assigned with boolean literals true and false respectively in C++. bool variable1 = true; bool variable2 = false; ... Read More
1K+ Views
In C++, tokens, identifiers, and keywords all are fundamental elements of a program. Tokens are the smallest units of code which are combine together to form complete program, where both keywords and identifiers are the types of tokens. The keywords are reserved words in the language, where each provides separate meanings to code and cannot be used as names by the programmer, whereas identifiers are names defined and used by programmers to represent variables, function or other user-defined elements. In this article, we will learn about all three in detail. Tokens in C++ A token is the smallest element of ... Read More
2K+ Views
A token is the smallest element of a C++ program that is meaningful to the compiler. The C++ parser recognizes these kinds of tokens: identifiers, keywords, literals, operators, punctuators, and other separators. A stream of these tokens makes up a translation unit. Tokens are usually separated by white space.The parser recognizes keywords, identifiers, literals, operators, and punctuators. Preprocessing tokens(like #include, #define, #if_def, etc.) are used in the preprocessing phases to generate the token stream passed to the compiler. The preprocessing token categories are header names, identifiers, preprocessing numbers, character literals, string literals, etc. that do not match one of the ... Read More
6K+ Views
There are several alternatives for compiling C++ on windows. Let's look at 2 of them:GCCTo install GCC on Windows you need to install MinGW. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program which should be named MinGW-.exe.While installing MinGW, at a minimum, you must install gcc-core, gcc-g++, Binutils, and the MinGW runtime, but you may wish to install more.Add the bin subdirectory of your MinGW installation to your PATH environment variable so that you can specify these tools on the command ... Read More
2K+ Views
Yes, In C++ both const and volatile keywords can be applied together in a variable. But it is used in situations like a read-only hardware register, or an output of another thread. In C++, they both are type qualifiers, which are used for different purposes in programming. In this article we will see the use of both keywords in C++. const Keyword The const keyword is used to declare the value of a variable as constant, meaning its value cannot be changed or modified later once initialized with const keyword. Example In this example PI value is set as constant ... Read More
852 Views
C++, also said to be a middle-level language, as it is a combination of both high-level features like abstraction with low-level language features like memory manipulation capabilities of assembly. It is a superset of C, as it compromises both C with object-oriented, therefore any valid C program will also be valid to C++ program.Top Features of C++ Programming Language C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. In this following article we will discuss some of the features of C++ that make it stand out among other programming languages: 1. ... Read More
744 Views
The const keyword in C++ is a keyword that is used to declare variables and objects as constant, which means the value declared using const cannot be changed or modified later, once they are initialized. This helps them prevent accidental modifications. For example, in a code, if we are using the value of PI, which has a fixed universal value and doesn't need any change, then we can declare it as a constant. When you declare the object with the const keyword, then the compiler places that value in ROM (Read-Only Memory), which protects it from being changed ... Read More