Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

PROGRAMMING GUM



This is a page for the very beginners of C++ Programming Language.Here you can find :-


If You Have Any Suggestion, Query, Or Thoughts To Share With Me, You Can Easily Contact Me.My Contact Details Are Here.


Contact Me 





 

Basic Terms In C++

Basic Terms In C++

    On this page we are going to check out some very basic terminology for the beginners of C++. These terms are often used in programming. So here we go :-)
Variables : As the name suggest, values of a variable may vary from time to time within a program. These variables are stored in memory of our computer (RAM) and can be used to store data of any kind we wish to. Lets have a geek definition of a variable which we can use to impress our teachers:
"A variable is a way of referring to a memory location used in a computer program to hold important data comprising of simple numbers, alphabets, symbols, and numbers with decimal values."
While making a program we can choose any name for our variable just by giving little attention to the following rules:
  • We can only declare a variable with a maximum name length of 32 characters.
Well, our first rule has got exception because the maximum length for name of any variable depend on compiler to compiler. But still If you follow this rule, it will only help you because long variables only results in typing efforts and taking away our precious time. Now lets roll on to our next rules.
  • The first character of any variable can be either an alphabet or an underscore( _ ).
  • No two variables can have same name in the same scope.
For the above rule, there is a little thing that we need to know. Small letters and capital letters are treated differently by computer. This is what we call case sensitivity. So the variable names pet, Pet, pEt, peT, PeT and PET all different variables instead of one.
  • Commas or spaces are not allowed to be used in variable names.
This Stinks!! We cannot use a space!!! What if we want to use a variable name like "my cute pet"? For the solution of this question there is a general trend of using an underscore( _ ) instead of a space. So the variable name can be declared as "my_cute_pet".
  • Except underscore no special symbols can be used while naming a variable.
  • A keyword cannot be used as  a variable name .
I know it feels a little bore to remind all the rules while declaring any variable and check whether or not its satisfying all the rule, but trust me once you start programming, you'll get used to it.
Keywords : These are some words whose meaning are already known to a compiler (in broad sense to a computer).So of course its understood that we cannot define a word which is already defined. And that is what our last rule is trying to tell.

Comments : These are the part of the code that make no sense to compiler. That means if comments are encountered, compiler simply skips them and starts reading the next part of the code, no matter what is written in it. These are generally used to tell
which part of code is designed to do what function to the reader of program and it has nothing to do with compiler. Comments are also known as code tags or simply tags. There are two types of tags in C++ :
  • Multi line comments: These comments are also called C style comments. We can cover any number of lines under their scope. The syntax for using C style comment is as follows....
    /*  comments line 1
    comment line 2
    ...........
    ...........
    comment line n */

  • Single line comments: These comments are also called C++ style comments. We can only cover a single line of code under their scope. They start with double slashes(//) followed by whatever is to be written in comments. So the syntax is
    //Comment covering only 1 line
We will not discuss a lot about comments as we will see how they work in our programs later. For now the given information is sufficient.
Written by T-Rex
<< History of C++                        Programming-Gum Home              Decision Making>>

History Of C++

History Of C++

    Our History begins in  the year 1979, when their lived a genius called Bjarne Stroustrup, working hard for his PhD thesis. By this time he was a master of a language, used for simulation, and so called Simula. Simula 67, which Stroustrup worked with is also known to be the first language to support a very important feature of programming called Object Oriented Programming (OOP).
    The Problem he encountered with Simula was with its speed. It was too slow to be used for any practical purpose.
    Stroustrup was a great supporter of the language 'C', which was raised by Dennis Ritchie in 1972. He began to work on a project which he called " C with Classes ". The main objective of his project to integrate the features of OOPs with C language.
    The first  'C with Classes' compiler was derived from C compile 'CPre' and was named as 'CFront'. It was programmed to translate a 'C with Classes' code to an ordinary 'C' language code. CFront left a legacy of 'C with Classes' and a way ahead of it was a long journey of development of many software. In 1993 it was abandoned because of the difficulties encountered while integrating it with new features of 'C with Classes'.
    In 1983 name of the language 'C with Classes' was changed to its current name 'C++'. Since the time C++ came into sight, it has always been a great choice for programmers to be used as a reliable, fast and secure language to develop software.
    This is how the glorious language, which we call C++, was born.
"History is written by victors
and many victors
used C++
to write their program."
written by T-Rex
                                                Programming-Gum Home               Basic terms in C++ >>