By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

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.
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)
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
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
Building Blocks of C Programming Language
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:

By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

6 mainly  All C program mostly contains following 6 constituents. Keyword Identifier Literal Comments Operators. Other keyword like tokens and aliases SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Keywords  Words which complier know the meaning.  Like a word in dictionary.  Very few in C.  More keywords which are specific to compliers SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

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 SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Demo Keywords  Some Keywords  int, void SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

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. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

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. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Demo Identifier  int a; SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Literals  Text and numbers normally.  Text will be in double quotes - “”;  Number are like 10, 0xAB ( hex ) etc. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Operator  + - * / % etc  Some are bit confusing for beginners as mean of the operator kind of different from math.  Example = is not “equal” but assignment. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

OperatorDemo  + plus operator sample SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Comment  Not complied by the complier  Mostly for the readability of code  /* anything – even more than one line */  // single line file should be.cpp SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Comments demo  Some comment in C SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Others  Mostly understood by the complier 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. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

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.  To many in production code.  #define ( pre processor definitions )and typedef is mostly for implementing this. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Alias or place holders  #include place holder for contents in the file stdio.h SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Example 1 #include void main () { printf (“hello world”); } SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Example 2 // helloworld.cpp : Defines the entry. // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Conclusion  Building blocks of the C.  Over all discussion with out much details like preprocess directives, typedef etc.  Don’t worry if are not able to understand completely at this point in time. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Thank you SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)