C Pointers 2013 Author Riko H i
|
|
- Bryce Maxwell
- 5 years ago
- Views:
Transcription
1 C Pointers 2013 Author Riko H i
2 Copyright 2013 CDorm.net All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, without the prior written permission of the publisher. Disclaimer All the material contained in this book is provided for educational and informational purposes only. No responsibility can be taken for any results or outcomes resulting from the use of this material. While every attempt has been made to provide information that is both accurate and effective, the author does not assume any responsibility for the accuracy or use/misuse of this information. C Pointers 2013 Author Riko H ii
3 Acknowledgements I would like to thank my father who kept pushing and encouraging me to make this book, for believing I have what it takes to make it real and helping to make this project possible, taking it from an idea to a realized e-book. Thank you, for without you this would not be possible. C Pointers 2013 Author Riko H iii
4 Table of Contents Chapter 1: C Pointers Basic Concept Chapter 2: Using Pointers in C Chapter 3: Arrays Chapter 4: Functions and Function Argument C Pointers 2013 Author Riko H iv
5 Chapter 1: C Pointers basic concepts Welcome to the world of pointers! If you are reading this then that means you probably have some trouble with pointers or maybe just want some extra information on the topic. Let s begin! If we are planning to dive into this vast world we first need to talk about a couple things. For starters we must understand what exactly a pointer is and how does it function in principle. You might be tempted to or have already searched the internet high and low for a quick, simple and easy definition of a pointer and came up with something like: a pointer is a programming language data type whose value refers directly to another value stored elsewhere in the computer memory using its address. It might then go into referencing registers and using all kinds of complicated analogies to explain the concept leaving you more confused than when you started reading. Now, time for that simple explanation you were waiting for. The first question anyone may ask is: What is a pointer and how do they work? Well, a pointer in programming is simply a reference to an actual variable. How do they work? I shall explain the concept two ways: First, let s imagine we have a mailman, some mail and a house for the mail to be delivered. We can look at the data as the mail, the variable as the house and the pointer as the mailman. What does a mailman do? You guessed it! Deliver! If you have a package to be delivered (i.e. data to be stored) you give the address of the house to the mailman, then you give the mailman the package, however, you expect that if you access/look into the house you would see the package. C Pointers 2013 Author Riko H Page 1
6 Similarly, when you use pointers to manipulate data you give data to the pointer but when the variable it is referencing is accessed it too shall have the data because the pointer (just like the mailman) is the gateway to the variable. If that concept didn t clear up anything for you let s look at it another way: Let s say we have a funnel, a marble and a bottle. The bottle is our variable, the marble our data and the funnel as our pointer. If we were to insert the funnel to our bottle and put the marble in the funnel what would you expect to happen? The marble would fall in the bottle. What if you look through the funnel or look directly in the bottle, what would you see? The marble. Similarly, when you use pointers to manipulate data you give data to the pointer but when the variable it is referencing is accessed it too shall have the data because the pointer (just like the funnel) is the gateway to the variable. If it sounds trivial or really simple that s because it isn t complicated once you have the right imagination. This brings up a really important point about pointers (no pun intended). As with the second analogy, you ll notice that the data (marble) is actually in the variable (bottle) and not in the pointer (funnel) itself. That s because pointers don t actually store data, they just tell the data where to go. That s really it guys, that s how simple the concept of a pointer is. C Pointers 2013 Author Riko H Page 2
7 Chapter 2: Using pointers in C Now that we understand how a pointer works let s get into using them because it s no use just knowing how being able to visualize how they work we have to be able to use them at our will. Declaring First, how do you declare a pointer? In C, the asterisk denotes a pointer. (type *variable) NB: the type of the pointer must match the type of data you plan to reference. float *p; This is a pointer float x; This is NOT a pointer. It s as simple as that. Using pointers After declaring but before you can start using a pointer, you must reference a variable (give the mailman the address of the house. This is done by using the & operation. p = &x; Notice when assigning address asterisk isn t used Only after assignment can manipulation can begin. C Pointers 2013 Author Riko H Page 3
8 Example #include <stdio.h> int main (void) { int *ptr; /*DECLARING POINTER*/ int x; ptr = &x; /*ASSIGNING POINTER TO X VARIABLE*/ *ptr = 5; printf(" %d ", *ptr); /*PRINTING POINTER*/ x = 3; printf(" %d ", x); /*PRINTING VARIABLE*/ printf(" %d ", *ptr); /*PRINTING POINTER*/ return (0); } What is the output of this program? Continue reading to find out! C Pointers 2013 Author Riko H Page 4
9 The output would be: We only set the pointer value to 5 once, do you understand why 3 occurred when we printed the pointer a second time? Remember the funnel and marble analogy? Lets recall that a pointer is simply a funnel connected to our variable so even though we didn t directly drop a 3 in the pointer we did drop it in the varibale ( x = 3; ) so when we looked in the funnel the second time we simply saw that 3. C Pointers 2013 Author Riko H Page 5
10 Let s try one more: #include <stdio.h> int main (void) { int *ptr1; int *ptr2; int x,y; ptr1 = &x; *ptr1 = 3; ptr2 = &y; y = 2; printf(" %d ", *ptr1 + *ptr2); printf(" %d ", x + y); printf(" %d ", x + *ptr1); ptr1 = &y; x = 10; printf(" %d ", *ptr1 + *ptr2); return (0);} What s the output this time? Take your time and check the next page when you ve got your answers! C Pointers 2013 Author Riko H Page 6
11 Output: Let s look into this one in detail: Let Line 1 be int *ptr1; Lines 1-3 are standard declaration commands. Line 4 connects the first pointer (*ptr1) to x. Line 5 then sends the number 3 to x via ptr1 Line 6 is the same as Line 4 this time assigning ptr2 to y. Instead of going via the pointer (*ptr2), Line 7 directly inserts 2 into y. Now comes the complicated part: printf(" %d ", *ptr1 + *ptr2); *ptr1 is simply x and *ptr2 is simply y therefore this line is printing x + y which is which is 5. Next, printf(" %d ", x + y); x + y is the same as *ptr1 + *ptr2 because ptr1 is referencing x and ptr2 is referencing y and we established from before to be 5. printf(" %d ", x + *ptr1); *ptr1 is pointing to x so x + *ptr1 is simply x + x which is 6. C Pointers 2013 Author Riko H Page 7
12 What do the next two lines do? ptr1 = &y; is nothing new to us by now all this is doing to taking the funnel out of bottle X and placing it in bottle Y. Therefore the line printf(" %d ", *ptr1 + *ptr2); simply prints the value of *ptr1 + *ptr2 which is the same as y + y since both pointers are now pointing towards the same variable y. C Pointers 2013 Author Riko H Page 8
13 Chapter 3: Arrays Now that we had covered pointers and are now ready to tackle problems involving them let s shift our attention and focus to another area in programming known as Arrays. Simple data types use a single cell to store a variable. As we dive into the world of programming we will see it is more efficient to group data items together than to give each variable its own cell. This group is called an array. Declaring and using an Array and its cells Declaring an array is as simple as declaring any other thing in C. We simply use the format: type variable[size] int my_array[3]; This says I want three integer variable for my using. If you are curious like I am you may be wondering where are the 3; they are: my_array[0] Notice that we start from 0 my_array[1] my_array[2]. We now have access to these three variables to do with what we wish simply by declaring the array. These cells can now be treated as normal variables and can be manipulated as such. This comes in handy in cases where you have lots of data to store. For instance is you have 900 numbers to store would rather have to declare 900 variables or would you rather type float numbers[900]; There are also extremely fast and efficient ways to fill and use arrays which we will get into in a later issue. Imagine filling all 900 of those slots with one line of code (hint: loops). C Pointers 2013 Author Riko H Page 9
14 Example: #include <stdio.h> int main (void) { int my_array[3]; my_array[1] = 7; my_array[2] = 4; my_array[0] = my_array[1] - my_array[2]; printf( " %d ", my_array[0] ); printf( " %d ", my_array[1] ); printf( " %d ", my_array[2] ); return (0); } What s the output? C Pointers 2013 Author Riko H Page 10
15 Chapter 4: Functions and Function Arguments Pointers? Check. Arrays? Check. Now that we have a clear understand on those, time to move on to Functions and Function Arguments. A function is nothing more than a program within a program. A dedicated set of code which when called upon carries out the objective of its code, this could be anything from an addition function which when called adds 4 numbers then multiplies it by 2 or a factorial function which when called takes and displays the factorial of a given number. It could even be a function which when called does nothing. The possibilities are endless when it comes to function because just like how they are trillions of programs that can be coded they are trillions of functions. Why? Because they ARE programs and you, the coder, decide what they do and how they do it. With that said, all I can do is show you how to set it up and you and your imagination and expertise learnt from this e-book and elsewhere can fill the inside with whatever you want! Declaring a function Declaring a function is not like declaring a pointer or array. As matter of fact, they aren t even declared in the same place. Declaring a function goes like this: #include <stdio.h> type name(arguments) We shall discuss arguments later. { /*FUNCTION CODE GOES HERE* } int main() {. return(0); } C Pointers 2013 Author Riko H Page 11
16 Types of functions Value functions These functions give back a value when called and therefore need to be stored when called. e.g. int addition (int num1,int num2) { return(num1+num2); } e.g. float multiply (int num1, int num2) { int x=2; return (num1*num2*x); } Void functions These functions return nothing and therefore do not need to be stored when called e.g. void print() { printf ( This function does nothing other than print this message ) } Notice there is no return command. C Pointers 2013 Author Riko H Page 12
17 Using a function After we declare a function along with the code of what it s going to do we now have to use it. Using a function is referred to as calling it and it is done in the main program and it is as simple and easy as calling a taxi. To call a value function we must first have a variable (must be same date type as function and is declared the standard way) to store the output of this function (i.e. the function is giving us something so we must have somewhere to put it). x = addition (4, 2); we have just called our addition function and the result shall be stored in x. For void functions, because it is not giving anything, we do not need to put it anywhere and can just call by typing its name: print(); Function Arguments Arguments is just a fancy word for inputs. So function arguments just means function inputs. As in, what data do you need (if any) from the main program for your function to operate? For instance if we were to make an addition function that adds two numbers, logically we would need the two numbers to add so our function arguments for example would be (int num1, int num2). They are declared in the heading of the function and do not need to be re-declared in the body. C Pointers 2013 Author Riko H Page 13
18 Example #include <stdio.h> int add (int x, int y) { return (x+y); } void print() { printf("our first void function! "); } int main (void) { int result; print(); printf("i wonder what is 2+3? "); result = add(2,3); printf(" %d ",result); return (0); } Can you tell me what the output is? Be careful! Let s see on the next page. C Pointers 2013 Author Riko H Page 14
19 Output Well folks, That s it basically Understanding C Pointers in a nutshell. I hope you like this book and I know it will be a little pocket guide to C Programming and I will be putting out some more short reports like this one to help struggling Student because I know I was there once. Shoot me an riko@cdorm.net or visit the site for more in the future. Until then. :>) C Pointers 2013 Author Riko H Page 15
20 Personal Message from Riko: I hope you find this ebook useful and that it helps you to create your own highly successful C programs! Feel free to check out my website and see the free video and share the link with anyone who might be interested. Free Video: For more free training on C Programming visit my website: click here C Pointers 2013 Author Riko H Page 16
Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements
Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In
More informationIntro. Scheme Basics. scm> 5 5. scm>
Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if
More informationThe name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.
Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that
More informationProblem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 15 Branching : IF ELSE Statement We are looking
More informationC++ for Java Programmers
Basics all Finished! Everything we have covered so far: Lecture 5 Operators Variables Arrays Null Terminated Strings Structs Functions 1 2 45 mins of pure fun Introduction Today: Pointers Pointers Even
More informationProgramming and Data Structure
Programming and Data Structure Dr. P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture # 09 Problem Decomposition by Recursion - II We will
More information5 R1 The one green in the same place so either of these could be green.
Page: 1 of 20 1 R1 Now. Maybe what we should do is write out the cases that work. We wrote out one of them really very clearly here. [R1 takes out some papers.] Right? You did the one here um where you
More informationProgramming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 10 Reference and Pointer Welcome to module 7 of programming in
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #34. Function with pointer Argument
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #34 Function with pointer Argument (Refer Slide Time: 00:05) So, here is the stuff that we have seen about pointers.
More information(Refer Slide Time: 01.26)
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture # 22 Why Sorting? Today we are going to be looking at sorting.
More informationComp 11 Lectures. Mike Shah. June 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 26, / 57
Comp 11 Lectures Mike Shah Tufts University June 26, 2017 Mike Shah (Tufts University) Comp 11 Lectures June 26, 2017 1 / 57 Please do not distribute or host these slides without prior permission. Mike
More informationLesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014
Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class
More informationPhysics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That
Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That 1. Introduction You have seen situations in which the way numbers are stored in a computer affects a program. For example, in the
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #47. File Handling
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #47 File Handling In this video, we will look at a few basic things about file handling in C. This is a vast
More information6 Stephanie Well. It s six, because there s six towers.
Page: 1 of 10 1 R1 So when we divided by two all this stuff this is the row we ended up with. 2 Stephanie Um hm. 3 R1 Isn t that right? We had a row of six. Alright. Now before doing it see if you can
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #33 Pointer Arithmetic
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #33 Pointer Arithmetic In this video let me, so some cool stuff which is pointer arithmetic which helps you to
More information9 R1 Get another piece of paper. We re going to have fun keeping track of (inaudible). Um How much time do you have? Are you getting tired?
Page: 1 of 14 1 R1 And this is tell me what this is? 2 Stephanie x times y plus x times y or hm? 3 R1 What are you thinking? 4 Stephanie I don t know. 5 R1 Tell me what you re thinking. 6 Stephanie Well.
More informationLecture Transcript While and Do While Statements in C++
Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some
More informationPointers in C/C++ 1 Memory Addresses 2
Pointers in C/C++ Contents 1 Memory Addresses 2 2 Pointers and Indirection 3 2.1 The & and * Operators.............................................. 4 2.2 A Comment on Types - Muy Importante!...................................
More informationGrade 6 Math Circles November 6 & Relations, Functions, and Morphisms
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Relations Let s talk about relations! Grade 6 Math Circles November 6 & 7 2018 Relations, Functions, and
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #44. Multidimensional Array and pointers
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #44 Multidimensional Array and pointers In this video, we will look at the relation between Multi-dimensional
More informationModule 10A Lecture - 20 What is a function? Why use functions Example: power (base, n)
Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Module 10A Lecture - 20 What is a function?
More information2.4 Choose method names carefully
2.4 Choose method names carefully We ve already discussed how to name a class in Section 1.1. Now it s time to name methods properly. I m suggesting this simple rule of thumb: builders are nouns, manipulators
More informationFirst of all, it is a variable, just like other variables you studied
Pointers: Basics What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the address (rather than the value)
More informationPointers, Arrays and Parameters
Pointers, Arrays and Parameters This exercise is different from our usual exercises. You don t have so much a problem to solve by creating a program but rather some things to understand about the programming
More information(Refer Slide Time 6:48)
Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about
More informationWin-Back Campaign- Re-Engagement Series
Win-Back Campaign- Re-Engagement Series At this point the re-engagement campaign has ended, so if the prospect still hasn t responded it s time to turn up the heat. NOTE: In the emails below, everywhere
More informationIntroduction to Access 97/2000
Introduction to Access 97/2000 PowerPoint Presentation Notes Slide 1 Introduction to Databases (Title Slide) Slide 2 Workshop Ground Rules Slide 3 Objectives Here are our objectives for the day. By the
More informationCombinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore
Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore Lecture - 5 Elementary concepts and basic counting principles So, welcome
More informationYup, left blank on purpose. You can use it to draw whatever you want :-)
Yup, left blank on purpose. You can use it to draw whatever you want :-) Chapter 1 The task I have assigned myself is not an easy one; teach C.O.F.F.E.E. Not the beverage of course, but the scripting language
More informationComputer Architecture Prof. Mainak Chaudhuri Department of Computer Science & Engineering Indian Institute of Technology, Kanpur
Computer Architecture Prof. Mainak Chaudhuri Department of Computer Science & Engineering Indian Institute of Technology, Kanpur Lecture - 7 Case study with MIPS-I So, we were discussing (Refer Time: 00:20),
More informationCMSC202 Computer Science II for Majors
CMSC202 Computer Science II for Majors Lecture 04 Pointers Dr. Katherine Gibson Based on slides by Chris Marron at UMBC Last Class We Covered C++ Functions Parts of a function: Prototype Definition Call
More informationCS 220: Introduction to Parallel Computing. Arrays. Lecture 4
CS 220: Introduction to Parallel Computing Arrays Lecture 4 Note: Windows I updated the VM image on the website It now includes: Sublime text Gitkraken (a nice git GUI) And the git command line tools 1/30/18
More informationSpectroscopic Analysis: Peak Detector
Electronics and Instrumentation Laboratory Sacramento State Physics Department Spectroscopic Analysis: Peak Detector Purpose: The purpose of this experiment is a common sort of experiment in spectroscopy.
More informationProblem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 18 Switch Statement (Contd.) And Introduction to
More informationModule 6. Campaign Layering
Module 6 Email Campaign Layering Slide 1 Hello everyone, it is Andy Mackow and in today s training, I am going to teach you a deeper level of writing your email campaign. I and I am calling this Email
More informationGrade Point Scales Standard Honors AP/College A B C D F Sample file
64 Transcripts Weighted Cumulative GPA When your student works extra hard and takes honors or college courses, they deserve a little credit. The best way to reflect this is through their GPA. They deserve
More informationWhat Are CSS and DHTML?
6/14/01 10:31 AM Page 1 1 What Are CSS and DHTML? c h a p t e r ch01.qxd IN THIS CHAPTER What Is CSS? What Is DHTML? DHTML vs. Flash Browser Hell What You Need to Know Already Welcome to the world of CSS
More informationUsability Test Report: Requesting Library Material 1
Usability Test Report: Requesting Library Material 1 Summary Emily Daly and Kate Collins conducted usability testing on the processes of requesting library material. The test was conducted at the temporary
More informationVLOOKUP() takes three mandatory parameters and one default/optional parameter:
Excel Lesson: Table Lookup Functions Topics Covered: VLookup() [Look across] HLookup() [Look down] Lookup() [Look almost anywhere] Related Functions (a list) We will not be examining all forms of these
More information(Refer Slide Time: 02.06)
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 27 Depth First Search (DFS) Today we are going to be talking
More informationData Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi.
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 18 Tries Today we are going to be talking about another data
More informationBoolean Expressions. Is Equal and Is Not Equal
3 MAKING CHOICES Now that we ve covered how to create constants and variables, you re ready to learn how to tell your computer to make choices. This chapter is about controlling the flow of a computer
More informationHello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications
Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this
More informationBoolean Expressions. Is Equal and Is Not Equal
3 MAKING CHOICES ow that we ve covered how to create constants and variables, you re ready to learn how to tell your computer to make choices. This chapter is about controlling the flow of a computer program
More informationProgramming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 08 Constants and Inline Functions Welcome to module 6 of Programming
More information2SKILL. Variables Lesson 6. Remembering numbers (and other stuff)...
Remembering numbers (and other stuff)... Let s talk about one of the most important things in any programming language. It s called a variable. Don t let the name scare you. What it does is really simple.
More informationSkill 1: Multiplying Polynomials
CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need
More informationGetting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners
Getting Started Excerpted from Hello World! Computer Programming for Kids and Other Beginners EARLY ACCESS EDITION Warren D. Sande and Carter Sande MEAP Release: May 2008 Softbound print: November 2008
More informationProgramming and Data Structures Prof. N. S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras
Programming and Data Structures Prof. N. S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 02 Structures, Pointers and Functions Welcome to
More informationIt s possible to get your inbox to zero and keep it there, even if you get hundreds of s a day.
It s possible to get your email inbox to zero and keep it there, even if you get hundreds of emails a day. It s not super complicated, though it does take effort and discipline. Many people simply need
More informationSPRITES Moving Two At the Same Using Game State
If you recall our collision detection lesson, you ll likely remember that you couldn t move both sprites at the same time unless you hit a movement key for each at exactly the same time. Why was that?
More informationOut for Shopping-Understanding Linear Data Structures English
Out for Shopping-Understanding Linear Data Structures English [MUSIC PLAYING] [MUSIC PLAYING] TANZEELA ALI: Hi, it's Tanzeela Ali. I'm a software engineer, and also a teacher at Superior University, which
More informationComputer Science 210: Data Structures
Computer Science 210: Data Structures Welcome to Data Structures! Data structures are fundamental building blocks of algorithms and programs Csci 210 is a study of data structures design efficiency implementation
More informationWeek 5, continued. This is CS50. Harvard University. Fall Cheng Gong
This is CS50. Harvard University. Fall 2014. Cheng Gong Table of Contents News... 1 Buffer Overflow... 1 Malloc... 6 Linked Lists... 7 Searching... 13 Inserting... 16 Removing... 19 News Good news everyone!
More informationPointers. 1 Background. 1.1 Variables and Memory. 1.2 Motivating Pointers Massachusetts Institute of Technology
Introduction to C++ Massachusetts Institute of Technology ocw.mit.edu 6.096 Pointers 1 Background 1.1 Variables and Memory When you declare a variable, the computer associates the variable name with a
More information1.7 Limit of a Function
1.7 Limit of a Function We will discuss the following in this section: 1. Limit Notation 2. Finding a it numerically 3. Right and Left Hand Limits 4. Infinite Limits Consider the following graph Notation:
More information(Refer Slide Time: 01:25)
Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 32 Memory Hierarchy: Virtual Memory (contd.) We have discussed virtual
More informationCOPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition
1 Starting Strong with Visual C# 2005 Express Edition Okay, so the title of this chapter may be a little over the top. But to be honest, the Visual C# 2005 Express Edition, from now on referred to as C#
More informationProgramming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur
Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 31 Static Members Welcome to Module 16 of Programming in C++.
More informationSir Syed University of Engineering and Technology. Computer Programming & Problem Solving ( CPPS ) Pointers. Chapter No 7
Computer Programming & Problem Solving ( CPPS ) Chapter No 7 Sir Syed University of Engineering & Technology Computer Engineering Department University Road, Karachi-75300, PAKISTAN Muzammil Ahmad Khan
More informationThe Stack, Free Store, and Global Namespace
Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information
More informationC++ for Java Programmers
Lecture 6 More pointing action Yesterday we considered: Pointer Assignment Dereferencing Pointers to Pointers to Pointers Pointers and Array Pointer Arithmetic 2 Todays Lecture What do we know 3 And now
More informationT H E I N T E R A C T I V E S H E L L
3 T H E I N T E R A C T I V E S H E L L The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform. Ada Lovelace, October 1842 Before
More informationIf Statements, For Loops, Functions
Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements
More information2016 All Rights Reserved
2016 All Rights Reserved Table of Contents Chapter 1: The Truth About Safelists What is a Safelist Safelist myths busted Chapter 2: Getting Started What to look for before you join a Safelist Best Safelists
More informationhp calculators HP 17bII+ Registers / Memory Banks The Stack Registers The Storage Registers
The Stack Registers The Storage Registers A register is a place where you store information. It is a memory bank where you put information in order to calculate a number or where you want to keep a number
More informationCIO 24/7 Podcast: Tapping into Accenture s rich content with a new search capability
CIO 24/7 Podcast: Tapping into Accenture s rich content with a new search capability CIO 24/7 Podcast: Tapping into Accenture s rich content with a new search capability Featuring Accenture managing directors
More information6.001 Notes: Section 15.1
6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define
More informationProgramming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras
Programming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras Module 12B Lecture - 41 Brief introduction to C++ Hello, welcome
More informationA Beginner s Guide to Successful Marketing
You ve got mail. A Beginner s Guide to Successful Email Marketing We believe that building successful email marketing campaigns has never been more important than it is now. But there s a problem; most
More informationMITOCW watch?v=0jljzrnhwoi
MITOCW watch?v=0jljzrnhwoi The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To
More informationGSAK (Geocaching Swiss Army Knife) GEOCACHING SOFTWARE ADVANCED KLASS GSAK by C3GPS & Major134
GSAK (Geocaching Swiss Army Knife) GEOCACHING SOFTWARE ADVANCED KLASS GSAK - 102 by C3GPS & Major134 Table of Contents About this Document... iii Class Materials... iv 1.0 Locations...1 1.1 Adding Locations...
More informationCS125 : Introduction to Computer Science. Lecture Notes #11 Procedural Composition and Abstraction. c 2005, 2004 Jason Zych
CS125 : Introduction to Computer Science Lecture Notes #11 Procedural Composition and Abstraction c 2005, 2004 Jason Zych 1 Lecture 11 : Procedural Composition and Abstraction Solving a problem...with
More informationUV Mapping to avoid texture flaws and enable proper shading
UV Mapping to avoid texture flaws and enable proper shading Foreword: Throughout this tutorial I am going to be using Maya s built in UV Mapping utility, which I am going to base my projections on individual
More information(Refer Slide Time: 06:01)
Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 28 Applications of DFS Today we are going to be talking about
More informationWeek - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02)
Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 04 Lecture - 01 Merge Sort (Refer
More informationSection 0.3 The Order of Operations
Section 0.3 The Contents: Evaluating an Expression Grouping Symbols OPERATIONS The Distributive Property Answers Focus Exercises Let s be reminded of those operations seen thus far in the course: Operation
More informationCompiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore
Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Module No. # 10 Lecture No. # 16 Machine-Independent Optimizations Welcome to the
More informationHere are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.
Preface Here are my online notes for my Algebra course that I teach here at Lamar University, although I have to admit that it s been years since I last taught this course. At this point in my career I
More informationRobert Ragan s TOP 3
Robert Ragan s TOP 3 Internet Genealogy Research POWER TECHNIQUES that Have Stunned Audiences POWER TECHNIQUES TWO: Robert s Unique "Gather, Store and Quick Find Method." You'll have to see it to believe
More informationGeneral Syntax. Operators. Variables. Arithmetic. Comparison. Assignment. Boolean. Types. Syntax int i; float j = 1.35; int k = (int) j;
General Syntax Statements are the basic building block of any C program. They can assign a value to a variable, or make a comparison, or make a function call. They must be terminated by a semicolon. Every
More informationSlide Set 6. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng
Slide Set 6 for ENCM 339 Fall 2017 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary October 2017 ENCM 339 Fall 2017 Section 01 Slide
More informationLecture 12 CSE July Today we ll cover the things that you still don t know that you need to know in order to do the assignment.
Lecture 12 CSE 110 20 July 1992 Today we ll cover the things that you still don t know that you need to know in order to do the assignment. 1 The NULL Pointer For each pointer type, there is one special
More informationLutheran High North Technology The Finder
Lutheran High North Technology shanarussell@lutheranhighnorth.org www.lutheranhighnorth.org/technology The Finder Your Mac s filing system is called the finder. In this document, we will explore different
More informationCS 4349 Lecture August 21st, 2017
CS 4349 Lecture August 21st, 2017 Main topics for #lecture include #administrivia, #algorithms, #asymptotic_notation. Welcome and Administrivia Hi, I m Kyle! Welcome to CS 4349. This a class about algorithms.
More information(Refer Slide Time 01:41 min)
Programming and Data Structure Dr. P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture # 03 C Programming - II We shall continue our study of
More informationProgramming, Data Structures and Algorithms Prof. Hema A Murthy Department of Computer Science and Engineering Indian Institute of Technology, Madras
Programming, Data Structures and Algorithms Prof. Hema A Murthy Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 54 Assignment on Data Structures (Refer Slide
More informationDecisions, Decisions. Testing, testing C H A P T E R 7
C H A P T E R 7 In the first few chapters, we saw some of the basic building blocks of a program. We can now make a program with input, processing, and output. We can even make our input and output a little
More informationCSE / ENGR 142 Programming I
CSE / ENGR 142 Programming I Variables, Values, and Types Chapter 2 Overview Chapter 2: Read Sections 2.1-2.6, 2.8. Long chapter, short snippets on many topics Later chapters fill in detail Specifically:
More informationChapter 1 Getting Started
Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different
More informationGoogle Analytics 101
Copyright GetABusinessMobileApp.com All rights reserved worldwide. YOUR RIGHTS: This book is restricted to your personal use only. It does not come with any other rights. LEGAL DISCLAIMER: This book is
More informationAt the end of this module, the student should be able to:
INTRODUCTION One feature of the C language which can t be found in some other languages is the ability to manipulate pointers. Simply stated, pointers are variables that store memory addresses. This is
More informationCS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018
CS 31: Intro to Systems Pointers and Memory Kevin Webb Swarthmore College October 2, 2018 Overview How to reference the location of a variable in memory Where variables are placed in memory How to make
More informationLecture 19 CSE August You taught me Language, and my profit on t is I know how to curse. William Shakspere, The Tempest, I, ii.
Lecture 19 CSE 110 5 August 1992 You taught me Language, and my profit on t is I know how to curse. William Shakspere, The Tempest, I, ii. 1 Left-Over Language Features Today was the day we saw the last
More informationCOSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22
COSC 2P91 Bringing it all together... Week 4b Brock University Brock University (Week 4b) Bringing it all together... 1 / 22 A note on practicality and program design... Writing a single, monolithic source
More informationSecond Examination Solution
University of Illinois at Urbana-Champaign Department of Computer Science Second Examination Solution CS 225 Data Structures and Software Principles Fall 2007 7p-9p, Thursday, November 8 Name: NetID: Lab
More informationLastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software.
Welcome to Basic Excel, presented by STEM Gateway as part of the Essential Academic Skills Enhancement, or EASE, workshop series. Before we begin, I want to make sure we are clear that this is by no means
More informationPreprocessor Directives
C++ By 6 EXAMPLE Preprocessor Directives As you might recall from Chapter 2, What Is a Program?, the C++ compiler routes your programs through a preprocessor before it compiles them. The preprocessor can
More information