Building Blocks of C Programming Language

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick The Programming Process rUse an editor to create a program file (source file). l contains the text of.
Advertisements

Variables in C Amir Haider Lecturer.
C Programming Course Overview
C++ Basics Variables, Identifiers, Assignments, Input/Output.
C Programming - Lecture 5
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Structure of a C program
C Programming Basics Lecture 5 Engineering H192 Winter 2005 Lecture 05
CS1061 C Programming Lecture 4: Indentifiers and Integers A.O’Riordan, 2004.
CS 192 Lecture 3 Winter 2003 December 5, 2003 Dr. Shafay Shamail.
COMPUTER PROGRAMMING. Data Types “Hello world” program Does it do a useful work? Writing several lines of code. Compiling the program. Executing the program.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Gator Engineering 1 Chapter 2 C Fundamentals (Continued) Copyright © 2008 W. W. Norton & Company. All rights reserved.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
CMSC 1041 Variables in C Declaring, Naming, Using Variables.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
CMSC 104, Version 8/061L09VariablesInC.ppt Variables in C Topics Naming Variables Declaring Variables Using Variables The Assignment Statement Reading.
2. C FUNDAMENTALS. Example: Printing a Message /* Illustrates comments, strings, and the printf function */ #include int main(void) { printf("To C, or.
Introduction to C Programming I Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
C++ Lesson 1.
Asst.Prof.Dr. Tayfun ÖZGÜR
Variables, Identifiers, Assignments, Input/Output
Control Statements in C
Basics (Variables, Assignments, I/O)
Data types Data types Basic types
C Programming Course Overview
LESSON 3 IO, Variables and Operators
C Short Overview Lembit Jürimägi.
Introduction to C Programming Language
مبانی کامپیوتر و برنامه سازی
CMSC 104, Section 4 Richard Chang
Introduction to C Programming
Reserved Words.
2008/10/01: Lecture 8 CMSC 104, Section 0101 John Y. Park
CMSC 104, Section 4 Richard Chang
Basics (Variables, Assignments, I/O)
null, true, and false are also reserved.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
פרטים נוספים בסילבוס של הקורס
Variables in C Topics Naming Variables Declaring Variables
Basics of ‘C’.
Built-In (a.k.a. Native) Types in C++
פרטים נוספים בסילבוס של הקורס
Introduction to C Programming
Govt. Polytechnic,Dhangar
Variables, Identifiers, Assignments, Input/Output
Variables in C Topics Naming Variables Declaring Variables
UMBC CMSC 104 – Section 01, Fall 2016
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Prof. Bhushan Trivedi Director GLS Institute of Computer Technology
Variables in C Declaring , Naming, and Using Variables.
2. Second Step for Learning C++ Programming • Data Type • Char • Float
Programming Language C Language.
Module 2 Variables, Data Types and Arithmetic
C Programming - Lecture 5
Troubleshooting Compiler Errors
Variables in C Topics Naming Variables Declaring Variables
2008/10/01: Lecture 8 CMSC 104, Section 0101 John Y. Park
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Variables in C Topics Naming Variables Declaring Variables
INTRODUCTION TO C.
Variables in C Topics Naming Variables Declaring Variables
Presentation transcript:

Building Blocks of C Programming Language By Anand George

6 mainly All C program mostly contains following 6 constituents. Keyword Identifier Literal Comments Operators. Other keyword like tokens and aliases

Keywords Words which complier know the meaning. Like a word in dictionary. Very few in C. More keywords which are specific to compilers

Mostly used keywords in C auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while

Demo Keywords Some Keywords int, void

Keyword It is required to know and understand the use of each keyword. Not that easy to get all in hand in the beginning. We will see one by one as we go.

Identifier Name of something in the program. Compiler wont understand them before introducing them with keywords. Like a name of a person which normal not in the dictionary.

Demo Identifier int a;

Literals Text and numbers normally. Text will be in double quotes - “”; Number are like 10, 0xAB ( hex ) etc.

Operator + - * / % etc Some are bit confusing for beginners as mean of the operator kind of different from math. Example = is not “equal” but assignment.

Operator Demo + plus operator sample

Comment Not compiled by the compiler Mostly for the readability of code /* anything – even more than one line */ // single line file should be .cpp

Comments demo Some comment in C

Others Mostly understood by the compiler mostly behave exactly like keywords from programmer standpoint. Example Preprocessor statement like #define, #include #pragma { } braces, ; semi colon Complier specific reserved keyword like __declspec is a reserved keyword ONLY in Microsoft C complier.

Other ( Aliases ) One of the items we already discussed but the name will be different. Just kind of old wine in new bottle. Nothing new but causes a lot of confusion to beginners looking at production code. Too many in production code. #define ( pre processor definitions )and typedef is mostly for implementing this.

Alias or place holders #include <stdio.h> place holder for contents in the file stdio.h

Example 1 #include <stdio.h> void main () { printf (“hello world”); }

Example 2 // helloworld.cpp : Defines the entry. // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; }

Conclusion Building blocks of the C. Over all discussion with out much details like preprocess directives, typedef etc. Don’t worry if you are not able to understand completely at this point in time.

Thank you