C++ Programming

C++ Programming


lvalue vs. rvalue in C++

Posted: 25 Apr 2013 10:17 AM PDT

In many situation we have to make a difference between expressions defining a value that can be addressed (and changed), which are called lvalue and value that can be only read, called rvalue. For example, the assignment operator expect a lvalue on the left and a rvalue on the right. So far the only lvalue we have seen are variables. #include <iostream> int main(int argc, char **argv) { int i

How to install Code Block 12.11 for C++ programs

Posted: 25 Apr 2013 10:05 AM PDT

Are you upgrading your code block for 10 to 12.11 here is a full setup video on how to setup code block 12.11 and running your first program

Role of compilation in C++

Posted: 25 Apr 2013 09:28 AM PDT

The compilation operation consists of translating a program written in a complex and human-readable language like C++, C, PASCAL, ADA, etc. into assembler code, which can be directly understood by the CPU. Practically, a compiler is itself a program which reads source files written by a human, for instance in C++, and generate object files which contains assembler code. Why using a language

Debugging in C++

Posted: 25 Apr 2013 09:18 AM PDT

There are two kinds of errors you'll run into when writing C++ programs:  compilation errors  runtime errors.  Compilation errors are problems raised by the compiler,generally resulting from violations of the syntax rules or misuse of types. These are often caused by typos and the like.  Runtime errors are problems that you only spot when you run the program: you did specify a legal

Understanding while and do-while

Posted: 25 Apr 2013 08:02 AM PDT

The while loop has a form similar to the if conditional: while(condition) { statement1 statement2 … } As long as condition holds, the block of statements will be repeatedly executed. If there is only one statement, the curly braces may be omitted.  while loop Here is an example: #include <iostream> using namespace std; int main() { int x = 0; while(x < 10) x = x + 1; 9 10 11 cout << "x

Values and Statements

Posted: 25 Apr 2013 07:38 AM PDT

First, a few definitions: •  A statement is a unit of code that does something –a basic building block of a program. • An expression is a statement that has a value – for instance, a number, a string, the sum of two numbers, etc. 4+2, x-1, and "Hello, world!\n" are all expressions. Not every statement is an expression. It makes no sense to talk about the value of an #include statement, for

Line-By-Line Explanation

Posted: 25 Apr 2013 07:32 AM PDT

Lets understand each and every thing in detail :- 1. // indicates that everything following it until the end of the line is a comment: it is ignored by the compiler. Another way to write a comment is to put it between /* and */ (e.g. x = 1 + /*sneaky comment here*/ 1;). A comment of this form may span multiple lines. Comments exist to explain non-obvious things going on in the code. Use them:

The Compilation Process

Posted: 25 Apr 2013 07:23 AM PDT

A program goes from text files(or source files)to processor instructions as follows: The Compilation Process Object files are intermediate files that represent an incomplete copy of the program: each source file only expresses a piece of the program, so when it is compiled into an object file, the object file has some markers indicating which missing pieces it depends on. The linker

Why Use a Language Like C++

Posted: 25 Apr 2013 06:48 AM PDT

At its core, a computer is just a processor with some memory, capable of running tiny instructions like "store 5 in memory location 23459." Why would we express a program as a text file in a programming language, instead of writing processor instructions? The advantages: 1. Conciseness: programming languages allow us to express common sequences of commands more concisely. C++ provides some

Understanding File handling

Posted: 25 Apr 2013 04:32 AM PDT

File handling in C++ works almost identically to terminal input/output. To use files, you write #include <fstream> at the top of your source file. Then you can access two classes from the std namespace: • ifstream – allows reading input from files  • ofstream – allows outputting to files Each open file is represented by a separate ifstream or an ofstream object. You can use ifstream objects

Open Tc with Cmd Command

Posted: 25 Apr 2013 03:57 AM PDT

hi benny mathur is back with some intersting video , this video show how to easly open Tc for writing c++ or C program


Post a Comment