Learning C/C++ Step-By-Step
Learning C/C++ Step-By-Step01. Step-by-Step C/C++ --- IntroductionMany people are really interested in learning and implementing C/C++ programs on their favorite platforms like DOS/Windows or Linux. If you are the one looking for a step-by-step guide to get started, this tutorial is for you. Let me know your comments on my tiny attempt to serve the community.
ContentsI. About C
II. Programming Basics
Introduction to Language & ExpressionsWhat is C?C is a compiler based programming language supports both high level and low level statements to interact directly with the hardware.
Development of C LanguageThe C programming language evolved from a succession of programming languages developed at Bell Laboratories in early 1970s. It was not until the late 1970s that this programming language began to gain widespread popularity and support. This was because until that time C compilers were not readily available for commercial use outside of Bell Laboratories. The C language was the outcome of Dennis Ritchie’s work on a project in Bell Laboratories, to invent a suitable high level language for writing an Operating System which manages the input and output devices of a computer, allocates its storage and schedules the running of other programs. UNIX operating system is written in the C language. Hence the Unix Operating system has C as its standard programming language. In fact over 90% of the operating system itself is written in the C language. So originally C language was designed and implemented on the Unix Operating System.
C as a general purpose LanguageC is a high level, procedural/structured, and general purpose programming language and resembles few other high level languages such as Fortran, Pascal, and PL/1. However, we cannot call the C language as a “Purely High Level Language”. C stands somewhere between the high-level languages meant for carrying on special activities and the low level languages such as assembly language of a machine because of some features like “System Independence”, “Limited Data Type”, “High Flexibility”, it is considered as a powerful language C has also become popular because of its portability across systems.
History of C
Features of C - Simple, versatile, general purpose language
II. Programming BasicsComponents of a program 1. Constants So, before writing serious programming we must be clear with all the above components of programs. According to above example every program is a set of statements, and statement is an instruction to the computer, which is a collection of constants, variables, operators and statements.
Constants A constant is a fixed value, which never altered during the execution of a program. 1. Primary Constants
Data TypesThe kind of data that the used variables can hold in a programming language is known as the data type. Basic data types are as follows: 1. Numeric Data Type 1. Numeric Data Type: Totally deals with the numbers. These numbers can be of integer (int) data type or real (float) data type. 2. Non-Numeric Data Type : Totally deals with characters. Any character or group of characters enclosed within quotes will be considered as non-numeric or character data type. 3. Integer Data Type : Deals with integers or whole numbers. All arithmetic operations can be achieved through this data type and the results are again integers. 4. Real Data Type : deals with real numbers or the numeric data, which includes fractions. All arithmetic operations can be achieved through this data type and the results can be real data type. 5. Logical or Boolean Data Type : can hold only either of the two values TRUE or FALSE at a time. In computer, a 1 (one) is stored for TRUE and a 0 (zero) is stored for FALSE. 6. Enumerated Data Type : Includes the unstructured data grouped together to lead to a new type. This data type is not standard and us usually defined by user. The following table shows the standard data types with their properties.
NOTE: The required ranges for signed and unsigned int are identical to those for signed and unsigned short. On compilers for 8 and 16 bit processors (including Intel x86 processors executing in 16 bit mode, such as under MS-DOS), an int is usually 16 bits and has exactly the same representation as a short. On compilers for 32 bit and larger processors (including Intel x86 processors executing in 32 bit mode, such as Win32 or Linux) an int is usually 32 bits long and has exactly the same representation as a long. I want you to refer this page for more information on int type for different processors: Ref: http://www.jk-technology.com/c/inttypes.html
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com





print: 
Recent comments
22 hours 35 min ago
1 day 3 min ago
1 day 3 hours ago
1 day 6 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago