This document provides an overview of pointers in C. It discusses that the stack is where local variables are stored, while the heap is an area of memory that the user handles explicitly by requesting and releasing memory through system calls. A pointer is a local variable that refers to a memory location on the heap. Common mistakes with pointers include using a pointer before allocation, changing the pointer instead of the referenced value, and forgetting to free heap memory. Functions can modify multiple values by passing in pointers. Linked lists and 2D arrays can be implemented using pointers to structures and pointers to pointers respectively.
Hamid Milton Mansaray teaches the chapter on arrays, pointers, and strings in week 8. Some key points covered include initializing and accessing elements of one-dimensional arrays using indexing or pointers, passing arrays to functions by reference using pointers, pointer arithmetic and comparing pointers, dynamic memory allocation for arrays using calloc and malloc, and how strings are implemented as character arrays in C with a null terminator. Examples are provided for summing arrays, merging sorted arrays, and basic pointer operations.
This document discusses pointers and references in C++. It explains that pointers store memory addresses while references act as aliases to existing variables. References must be initialized, cannot be null, and cannot point to different variables, while pointers can be reassigned. The document also covers using pointers and references with arrays and strings, passing references to functions, and returning references from functions.
The document discusses key concepts in C++ including procedural programming, object-oriented programming, pointers, dynamic memory allocation, and data types. It covers procedural concepts like functions and parameters. Object-oriented concepts like encapsulation, inheritance, and polymorphism are explained. Pointers, references, and dynamic memory allocation using operators like new and delete are summarized. The different data types in C++ like simple, structured, and pointer types are also briefly introduced.
Bsc cs 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
1. Pointers allow functions to modify variables in the calling function by passing the address of variables. This allows functions to return multiple values.
2. Structures can be passed to functions using pointers to avoid expensive copying of large structures. Pointers to structures use -> to access members.
3. Pointers must match the type of the variable being pointed to. NULL is used to indicate an empty pointer. Dereferencing NULL causes crashes.
Diploma ii cfpc- u-5.1 pointer, structure ,union and intro to file handlingRai University
This document discusses pointers in C programming. It defines pointers as variables that contain the memory addresses of other variables. Pointers allow functions to modify variables in the calling function and facilitate dynamic memory allocation. The key pointer operators are asterisk (*) for dereferencing and ampersand (&) for getting a variable's address. Examples demonstrate declaring and using pointers, passing pointers to functions, pointers to structures, and the NULL pointer value. Pointer syntax and dereferencing must match the variable type to avoid errors.
Mca 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
Pointers allow programs to store and pass around memory addresses. They enable functions to modify variables in the calling function. Pointers must match the type of the variable being pointed to. Common pointer operators are asterisk (*) to dereference and ampersand (&) to get an address. Pointers can point to primitive types, arrays, structs, and dynamically allocated memory. They require care to avoid bugs but enable memory sharing and dynamic memory allocation. Pointers to structs are commonly passed to functions to efficiently access struct members.
pointer, structure ,union and intro to file handlingRai University
1) Pointers allow programs to store and pass around the memory addresses of variables and dynamically allocated memory. They provide a way to indirectly access and modify data from different parts of a program.
2) Pointers must be declared with a variable type and the * symbol. Common pointer operators are * to dereference a pointer and & to get the address of a variable.
3) Passing pointers to functions allows the function to modify the variables in the caller's scope by dereferencing the pointers. This is commonly used to return multiple values from a function.
The document discusses pointers in C programming. It defines a pointer as a variable that stores the memory address of another variable rather than the actual data. Pointers can be used to return multiple values from a function, pass arrays and strings to functions, and dynamically allocate and access memory. The key pointer operators are the address of (&) operator, which returns the address of its operand, and the dereferencing (*) operator, which refers to the object a pointer points to. Pointers can be passed to functions by value or by reference. The document also discusses structures, which allow grouping of different data types, and arrays, which can be passed to functions where only the array address is passed.
Hamid Milton Mansaray teaches the chapter on arrays, pointers, and strings in week 8. Some key points covered include initializing and accessing elements of one-dimensional arrays using indexing or pointers, passing arrays to functions by reference using pointers, pointer arithmetic and comparing pointers, dynamic memory allocation for arrays using calloc and malloc, and how strings are implemented as character arrays in C with a null terminator. Examples are provided for summing arrays, merging sorted arrays, and basic pointer operations.
This document discusses pointers and references in C++. It explains that pointers store memory addresses while references act as aliases to existing variables. References must be initialized, cannot be null, and cannot point to different variables, while pointers can be reassigned. The document also covers using pointers and references with arrays and strings, passing references to functions, and returning references from functions.
The document discusses key concepts in C++ including procedural programming, object-oriented programming, pointers, dynamic memory allocation, and data types. It covers procedural concepts like functions and parameters. Object-oriented concepts like encapsulation, inheritance, and polymorphism are explained. Pointers, references, and dynamic memory allocation using operators like new and delete are summarized. The different data types in C++ like simple, structured, and pointer types are also briefly introduced.
Bsc cs 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
1. Pointers allow functions to modify variables in the calling function by passing the address of variables. This allows functions to return multiple values.
2. Structures can be passed to functions using pointers to avoid expensive copying of large structures. Pointers to structures use -> to access members.
3. Pointers must match the type of the variable being pointed to. NULL is used to indicate an empty pointer. Dereferencing NULL causes crashes.
Diploma ii cfpc- u-5.1 pointer, structure ,union and intro to file handlingRai University
This document discusses pointers in C programming. It defines pointers as variables that contain the memory addresses of other variables. Pointers allow functions to modify variables in the calling function and facilitate dynamic memory allocation. The key pointer operators are asterisk (*) for dereferencing and ampersand (&) for getting a variable's address. Examples demonstrate declaring and using pointers, passing pointers to functions, pointers to structures, and the NULL pointer value. Pointer syntax and dereferencing must match the variable type to avoid errors.
Mca 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
Pointers allow programs to store and pass around memory addresses. They enable functions to modify variables in the calling function. Pointers must match the type of the variable being pointed to. Common pointer operators are asterisk (*) to dereference and ampersand (&) to get an address. Pointers can point to primitive types, arrays, structs, and dynamically allocated memory. They require care to avoid bugs but enable memory sharing and dynamic memory allocation. Pointers to structs are commonly passed to functions to efficiently access struct members.
pointer, structure ,union and intro to file handlingRai University
1) Pointers allow programs to store and pass around the memory addresses of variables and dynamically allocated memory. They provide a way to indirectly access and modify data from different parts of a program.
2) Pointers must be declared with a variable type and the * symbol. Common pointer operators are * to dereference a pointer and & to get the address of a variable.
3) Passing pointers to functions allows the function to modify the variables in the caller's scope by dereferencing the pointers. This is commonly used to return multiple values from a function.
The document discusses pointers in C programming. It defines a pointer as a variable that stores the memory address of another variable rather than the actual data. Pointers can be used to return multiple values from a function, pass arrays and strings to functions, and dynamically allocate and access memory. The key pointer operators are the address of (&) operator, which returns the address of its operand, and the dereferencing (*) operator, which refers to the object a pointer points to. Pointers can be passed to functions by value or by reference. The document also discusses structures, which allow grouping of different data types, and arrays, which can be passed to functions where only the array address is passed.
A pointer is a variable that stores the memory address of another variable. Pointers allow accessing and modifying the data stored at the referenced memory location. Pointers can be declared by specifying the data type followed by an asterisk, and are initialized by assigning the address of a variable to the pointer variable. Pointer variables can be used in expressions and arithmetic and can be passed to functions to modify the referenced data. Arrays can also be accessed and traversed using pointers by treating the array name as a pointer to its first element. Pointers to functions allow functions to be passed as arguments and enables polymorphism.
pointer, structure ,union and intro to file handlingRai University
Pointers allow programs to store and pass around memory addresses. Pointers in C can point to primitive data types, arrays, structs, and other pointers. Declaring a pointer requires a * before the pointer name and specifying the type of data it will point to. The & operator returns the memory address of a variable, which can be stored in a pointer. The * operator dereferences a pointer to access the data being pointed to. Pointers enable functions to modify variables in the calling function and return multiple values. They also make structs more efficient to pass to functions. Care must be taken to avoid bugs from misusing pointers.
Btech 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
1) Pointers allow functions to modify variables in the calling function by passing the address of variables. This allows functions to return multiple values.
2) Structures can be passed to functions using pointers to avoid expensive copying of large structures. Pointers to structures use -> to access members.
3) Pointers must match the type of the variable being pointed to. Dereferencing a NULL pointer causes a program to crash. Pointers can make code more efficient by passing addresses rather than values.
The document discusses pointers in C programming. It defines pointers as variables that store memory addresses and explains pointer syntax and declaration. It discusses dereferencing pointers to access the value of the variable being pointed to. The document also covers passing pointers to functions, null pointers, generic pointers, pointer arithmetic, and pointers to pointers. It provides examples of how to use pointers to pass arguments by reference and pass functions as arguments using pointers to functions.
This document provides an overview of pointers in C programming. It defines pointers as variables that store memory addresses rather than values. Pointers have several useful applications like accessing variables outside functions, passing information between functions, and more efficiently handling data tables. The document explains how to declare pointer variables, assign the address of a variable to a pointer, dereference a pointer to access the value at an address, and pass pointers to functions. It also discusses pointers and arrays, structures, and arrays of structures.
The document provides information about pointers in C++. It discusses that pointers are variables that store memory addresses and have three main uses: 1) direct access and manipulation of memory locations; 2) support for dynamic memory allocation; and 3) potential improvement of efficiency for certain routines. Pointers can cause crashes if misused. The document then covers key pointer concepts like declaration and initialization of pointers, pointer arithmetic, dynamic memory allocation using new and delete operators, pointers and arrays, pointers and structures, and pointers and constants.
Dynamic memory allocation allows programs to request additional memory at runtime as needed, rather than having a fixed amount allocated at compile time. The malloc function allocates memory on the heap and returns a pointer to it. This memory must later be freed using free to avoid memory leaks. Calloc initializes allocated memory to zero, while realloc changes the size of previously allocated memory. C supports dynamic memory allocation through library functions like malloc, calloc, free and realloc.
Pointers in C++ allow programs to store and manipulate memory addresses. Pointers contain the address of another variable. They are used to pass variables by reference into functions and access array elements. A pointer is initialized by assigning the address of a variable to it using the & operator. The * operator is used for indirection to access the value at the address stored in the pointer. Pointers can also point to other pointers. Arrays of pointers store multiple memory addresses. The name of an array acts as a constant pointer containing the base address of the array.
Pointers allow programs to indirectly reference memory locations. They store the address of another variable. Pointers are used to pass variables by reference, dynamically allocate memory, and build complex data structures like linked lists. Pointer variables are declared with a type followed by an asterisk (e.g. int *ptr). The ampersand (&) operator returns the address of its operand. The indirection (*) operator accesses the value at the address a pointer refers to. Pointers can be passed as function parameters or returned as values. Dynamic memory allocation with functions like malloc, calloc, and realloc allow programs to request memory at runtime.
Pointers provide references to memory locations in a program. They are used to pass variables by reference, access array elements, and dynamically allocate memory. A pointer variable contains the address of another variable. The address (&) operator returns the memory address of a variable. The indirection (*) operator accesses the value of the variable a pointer is pointing to. Pointers allow modifying variables passed to functions and returning addresses from functions. Memory is dynamically allocated using functions like malloc(), calloc(), and realloc() and freed using free(). Multidimensional arrays can be dynamically allocated by allocating an array of pointers and having each pointer point to a 1D array.
The document provides information about pointers in the C programming language. It discusses pointer declaration, definition, initialization, dereferencing, arithmetic operations like incrementing and decrementing, and relationships between arrays and pointers. It also covers dynamic memory allocation functions like malloc(), calloc(), free(), and realloc(). Pointers allow accessing and manipulating data in memory and performing tasks like dynamic memory allocation.
The document discusses the different storage classes in C - automatic, external, static, and register variables. It also explains pointers in C, including how to declare pointer variables, use the address & and dereference * operators, perform pointer arithmetic, and pass pointers to functions to allow the called function to modify the passed variables (pass by reference).
data structures using C 2 sem BCA univeristy of mysoreambikavenkatesh2
The document discusses reallocating memory using the realloc() function in C. It provides code to allocate memory for an integer array, print the memory addresses, reallocate the array to a larger size, and print the new memory addresses. The memory addresses for the previously allocated blocks do not change after reallocating, but new contiguous blocks are added to increase the array size.
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before you can use it to store any variable address.
There are few important operations, which we will do with the help of pointers very frequently. (a) we define a pointer variable (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand.
This document provides an overview of a 5-day training course on C basics for data structures. The course will cover topics such as arrays, pointers, and structures. Specific topics for arrays include how they are stored in memory, static versus dynamic allocation, and pointers to arrays. Pointers will cover what they are, pointer arithmetic, and pointers to pointers. The document includes example code for allocating memory dynamically using malloc and free.
Pointer variables store the memory addresses of other variables. They can be used to access and modify the values stored at those addresses. Pointers allow values to be passed by reference rather than by value, enabling changes made within functions to be reflected back in the calling function. Common pointer operations include dereferencing a pointer to access the value at an address, pointer arithmetic to increment or decrement a pointer to other memory locations, and passing pointers as function arguments to allow modification of variable values.
This presentation of ROBO INDIA comprises all of the elements that must be known to learn the programming language C.
This ppt also explains all these topics in details.
We welcome all you views and queries. Please write us, we are found at-
website: http://roboindia.com
mail: info@roboindia.com
Pointers point to memory addresses that store values. There are different types of pointers for different data types like integers, characters, and doubles. Pointers can be initialized using the address-of operator (&) and dereferenced using the asterisk (*) operator to access the value stored at a memory address. Memory for pointers must be dynamically allocated using functions like malloc() and freed using free() to avoid memory leaks. Pointers allow passing arguments by reference so functions can modify values.
The document provides lecture notes on C programming concepts including arrays, control statements, pointers, functions, and dynamic memory allocation. It defines arrays as fixed-size collections that store elements of the same type in contiguous memory locations. Control statements covered include for, while, do-while loops, and break and continue keywords. Pointers are explained as variables that store memory addresses and are used for call by reference with functions. Function prototypes, definitions, and calling conventions are demonstrated. Finally, pointers to functions are shown as allowing functions to be passed as parameters to other functions.
The document discusses data structures including linked lists and trees. It describes linked lists, their implementations and operations. Specifically, it covers single, double and circular linked lists. It also covers different types of trees like binary trees, binary search trees, AVL trees, B-trees and heaps. It discusses their representations, implementations and traversal algorithms. Finally, it provides information on dynamic memory allocation in C using functions like malloc(), calloc(), free() and realloc().
The document describes text mining and web mining. It discusses the need for text mining due to the large amount of unstructured data organizations hold. It differentiates between text mining, web mining, and data mining. The document outlines the text mining process of establishing a corpus from unstructured data sources, introducing structure to create a term-document matrix, and extracting knowledge from the matrix. It also discusses applications of text mining in domains like security, medicine, marketing, and academics.
This document summarizes several routing protocols for ad hoc wireless networks. It describes the challenges in this domain including dynamic topologies and limited resources. It then categorizes and explains several types of routing protocols, including proactive protocols like DSDV, reactive protocols like AODV and DSR, hybrid protocols like ZRP, and geographic routing. It provides details on the route discovery and maintenance mechanisms of some of these prominent protocols. It also discusses theoretical limits on network capacity and the impact of mobility and hierarchy.
A pointer is a variable that stores the memory address of another variable. Pointers allow accessing and modifying the data stored at the referenced memory location. Pointers can be declared by specifying the data type followed by an asterisk, and are initialized by assigning the address of a variable to the pointer variable. Pointer variables can be used in expressions and arithmetic and can be passed to functions to modify the referenced data. Arrays can also be accessed and traversed using pointers by treating the array name as a pointer to its first element. Pointers to functions allow functions to be passed as arguments and enables polymorphism.
pointer, structure ,union and intro to file handlingRai University
Pointers allow programs to store and pass around memory addresses. Pointers in C can point to primitive data types, arrays, structs, and other pointers. Declaring a pointer requires a * before the pointer name and specifying the type of data it will point to. The & operator returns the memory address of a variable, which can be stored in a pointer. The * operator dereferences a pointer to access the data being pointed to. Pointers enable functions to modify variables in the calling function and return multiple values. They also make structs more efficient to pass to functions. Care must be taken to avoid bugs from misusing pointers.
Btech 1 pic u-5 pointer, structure ,union and intro to file handlingRai University
1) Pointers allow functions to modify variables in the calling function by passing the address of variables. This allows functions to return multiple values.
2) Structures can be passed to functions using pointers to avoid expensive copying of large structures. Pointers to structures use -> to access members.
3) Pointers must match the type of the variable being pointed to. Dereferencing a NULL pointer causes a program to crash. Pointers can make code more efficient by passing addresses rather than values.
The document discusses pointers in C programming. It defines pointers as variables that store memory addresses and explains pointer syntax and declaration. It discusses dereferencing pointers to access the value of the variable being pointed to. The document also covers passing pointers to functions, null pointers, generic pointers, pointer arithmetic, and pointers to pointers. It provides examples of how to use pointers to pass arguments by reference and pass functions as arguments using pointers to functions.
This document provides an overview of pointers in C programming. It defines pointers as variables that store memory addresses rather than values. Pointers have several useful applications like accessing variables outside functions, passing information between functions, and more efficiently handling data tables. The document explains how to declare pointer variables, assign the address of a variable to a pointer, dereference a pointer to access the value at an address, and pass pointers to functions. It also discusses pointers and arrays, structures, and arrays of structures.
The document provides information about pointers in C++. It discusses that pointers are variables that store memory addresses and have three main uses: 1) direct access and manipulation of memory locations; 2) support for dynamic memory allocation; and 3) potential improvement of efficiency for certain routines. Pointers can cause crashes if misused. The document then covers key pointer concepts like declaration and initialization of pointers, pointer arithmetic, dynamic memory allocation using new and delete operators, pointers and arrays, pointers and structures, and pointers and constants.
Dynamic memory allocation allows programs to request additional memory at runtime as needed, rather than having a fixed amount allocated at compile time. The malloc function allocates memory on the heap and returns a pointer to it. This memory must later be freed using free to avoid memory leaks. Calloc initializes allocated memory to zero, while realloc changes the size of previously allocated memory. C supports dynamic memory allocation through library functions like malloc, calloc, free and realloc.
Pointers in C++ allow programs to store and manipulate memory addresses. Pointers contain the address of another variable. They are used to pass variables by reference into functions and access array elements. A pointer is initialized by assigning the address of a variable to it using the & operator. The * operator is used for indirection to access the value at the address stored in the pointer. Pointers can also point to other pointers. Arrays of pointers store multiple memory addresses. The name of an array acts as a constant pointer containing the base address of the array.
Pointers allow programs to indirectly reference memory locations. They store the address of another variable. Pointers are used to pass variables by reference, dynamically allocate memory, and build complex data structures like linked lists. Pointer variables are declared with a type followed by an asterisk (e.g. int *ptr). The ampersand (&) operator returns the address of its operand. The indirection (*) operator accesses the value at the address a pointer refers to. Pointers can be passed as function parameters or returned as values. Dynamic memory allocation with functions like malloc, calloc, and realloc allow programs to request memory at runtime.
Pointers provide references to memory locations in a program. They are used to pass variables by reference, access array elements, and dynamically allocate memory. A pointer variable contains the address of another variable. The address (&) operator returns the memory address of a variable. The indirection (*) operator accesses the value of the variable a pointer is pointing to. Pointers allow modifying variables passed to functions and returning addresses from functions. Memory is dynamically allocated using functions like malloc(), calloc(), and realloc() and freed using free(). Multidimensional arrays can be dynamically allocated by allocating an array of pointers and having each pointer point to a 1D array.
The document provides information about pointers in the C programming language. It discusses pointer declaration, definition, initialization, dereferencing, arithmetic operations like incrementing and decrementing, and relationships between arrays and pointers. It also covers dynamic memory allocation functions like malloc(), calloc(), free(), and realloc(). Pointers allow accessing and manipulating data in memory and performing tasks like dynamic memory allocation.
The document discusses the different storage classes in C - automatic, external, static, and register variables. It also explains pointers in C, including how to declare pointer variables, use the address & and dereference * operators, perform pointer arithmetic, and pass pointers to functions to allow the called function to modify the passed variables (pass by reference).
data structures using C 2 sem BCA univeristy of mysoreambikavenkatesh2
The document discusses reallocating memory using the realloc() function in C. It provides code to allocate memory for an integer array, print the memory addresses, reallocate the array to a larger size, and print the new memory addresses. The memory addresses for the previously allocated blocks do not change after reallocating, but new contiguous blocks are added to increase the array size.
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before you can use it to store any variable address.
There are few important operations, which we will do with the help of pointers very frequently. (a) we define a pointer variable (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand.
This document provides an overview of a 5-day training course on C basics for data structures. The course will cover topics such as arrays, pointers, and structures. Specific topics for arrays include how they are stored in memory, static versus dynamic allocation, and pointers to arrays. Pointers will cover what they are, pointer arithmetic, and pointers to pointers. The document includes example code for allocating memory dynamically using malloc and free.
Pointer variables store the memory addresses of other variables. They can be used to access and modify the values stored at those addresses. Pointers allow values to be passed by reference rather than by value, enabling changes made within functions to be reflected back in the calling function. Common pointer operations include dereferencing a pointer to access the value at an address, pointer arithmetic to increment or decrement a pointer to other memory locations, and passing pointers as function arguments to allow modification of variable values.
This presentation of ROBO INDIA comprises all of the elements that must be known to learn the programming language C.
This ppt also explains all these topics in details.
We welcome all you views and queries. Please write us, we are found at-
website: http://roboindia.com
mail: info@roboindia.com
Pointers point to memory addresses that store values. There are different types of pointers for different data types like integers, characters, and doubles. Pointers can be initialized using the address-of operator (&) and dereferenced using the asterisk (*) operator to access the value stored at a memory address. Memory for pointers must be dynamically allocated using functions like malloc() and freed using free() to avoid memory leaks. Pointers allow passing arguments by reference so functions can modify values.
The document provides lecture notes on C programming concepts including arrays, control statements, pointers, functions, and dynamic memory allocation. It defines arrays as fixed-size collections that store elements of the same type in contiguous memory locations. Control statements covered include for, while, do-while loops, and break and continue keywords. Pointers are explained as variables that store memory addresses and are used for call by reference with functions. Function prototypes, definitions, and calling conventions are demonstrated. Finally, pointers to functions are shown as allowing functions to be passed as parameters to other functions.
The document discusses data structures including linked lists and trees. It describes linked lists, their implementations and operations. Specifically, it covers single, double and circular linked lists. It also covers different types of trees like binary trees, binary search trees, AVL trees, B-trees and heaps. It discusses their representations, implementations and traversal algorithms. Finally, it provides information on dynamic memory allocation in C using functions like malloc(), calloc(), free() and realloc().
The document describes text mining and web mining. It discusses the need for text mining due to the large amount of unstructured data organizations hold. It differentiates between text mining, web mining, and data mining. The document outlines the text mining process of establishing a corpus from unstructured data sources, introducing structure to create a term-document matrix, and extracting knowledge from the matrix. It also discusses applications of text mining in domains like security, medicine, marketing, and academics.
This document summarizes several routing protocols for ad hoc wireless networks. It describes the challenges in this domain including dynamic topologies and limited resources. It then categorizes and explains several types of routing protocols, including proactive protocols like DSDV, reactive protocols like AODV and DSR, hybrid protocols like ZRP, and geographic routing. It provides details on the route discovery and maintenance mechanisms of some of these prominent protocols. It also discusses theoretical limits on network capacity and the impact of mobility and hierarchy.
The document provides an overview of sensor networks, which consist of low-cost, low-power sensor devices that can collect, process, analyze, and disseminate data from various environments. Sensor networks enable information gathering and processing through reliable monitoring using small, wireless sensor nodes. Key challenges for sensor networks include extending the lifetime of the network given limited energy resources and adapting to changing topologies as nodes fail or move. Sensor networks operate using self-organizing, multi-hop wireless connections between nodes that coordinate sensing tasks and route data back to central access points.
This document provides an introduction to data mining concepts and techniques. It defines data mining as the extraction of implicit, previously unknown, and potentially useful patterns from large amounts of data. The document outlines the data mining process and how data mining draws upon multiple disciplines including database technology, statistics, machine learning, and visualization. It also describes common data mining functionalities like classification, clustering, association rule mining, and discusses some of the most popular data mining algorithms.
The document provides an introduction to data mining, including why it is used from both commercial and scientific viewpoints. It discusses how much data is being collected and stored, and how data mining can help make sense of large datasets that would be impossible for humans to analyze alone. It describes some of the largest databases in the world and different data mining tasks like classification, regression, clustering, and association rule learning. Examples are given for how data mining can be applied to problems like credit risk assessment, fraud detection, customer churn prediction, and direct marketing.
This document provides an overview of a data mining course. It discusses that the course will be taught by George Kollios and will cover topics like data warehouses, association rule mining, clustering, classification, and advanced topics. It also outlines the grading breakdown and schedule. Additionally, it defines data mining and describes common data mining tasks like classification, clustering, and association rule mining. It provides examples of applications and discusses the data mining process.
An IP address is a unique number that identifies a device on a network. IP stands for Internet Protocol, which defines the format for sending data over the internet or networks. IP addresses contain location information and allow devices to communicate by identifying the destination address. They are divided into a network and host part, and can be represented in decimal or binary notation. IPv4 is currently used, while IPv6 is an upcoming replacement that improves on IPv4. IP addresses can be public, assigned by ISPs, or private for internal networks.
The document describes a chapter about the application layer from a textbook on computer networking. It covers several topics:
1. An introduction to the application layer including common network applications, client-server and peer-to-peer architectures, and how processes communicate over the network.
2. Descriptions of the HTTP and TCP protocols that are commonly used at the application layer. HTTP uses the TCP transport layer to provide reliable data transfer for web applications.
3. An overview of how non-persistent and persistent HTTP connections work, with persistent connections allowing multiple objects to be transferred over a single TCP connection between a client and server.
MOBILE & WIRELESS SECURITY And MOBILE & WIRELESS SECURITYDEEPAK948083
This document provides an overview of mobile and wireless security. It discusses the need for security as wireless networks become more prevalent and outlines some common security threats like spoofing, sniffing, tampering and theft. It then describes various security technologies used to address these threats, including cryptography, digital certificates, digital signatures and public key infrastructure. Specific security protocols like SSL, TLS and IPSec are also mentioned. The document emphasizes that securing wireless networks requires considering authentication, data integrity, confidentiality, authorization and non-repudiation across the entire environment.
This document provides an introduction to data structures presented by Prof. K. Adisesha. It defines data structures as representations of logical relationships between data elements that consider both the elements and their relationships. Data structures affect both structural and functional aspects of programs. They are classified as primitive or non-primitive, with primitive structures operated on directly by machine instructions and non-primitive structures derived from primitive ones. Linear data structures like stacks and queues have elements in sequence, while non-linear structures like trees and graphs have hierarchical or parent-child relationships. Common operations on data structures include traversal, insertion, selection, searching, sorting, merging, and deletion. Arrays are also discussed in detail as a fundamental data structure.
This document discusses different types of malicious code such as viruses, Trojan horses, logic bombs, and worms. It defines each type and provides examples. Viruses can attach to programs by appending code, surrounding code, or integrating with/replacing code. They gain control by overwriting targets or changing pointers. Common places for viruses include boot sectors, system files, and memory-resident programs. Viruses can be detected through their storage patterns, execution patterns, and transmission patterns. Prevention methods include using trusted software sources, testing new software in isolation, and regularly using virus detectors.
1) Elliptic curve cryptography uses elliptic curves over finite fields to provide a method for constructing cryptographic groups.
2) The security of elliptic curve cryptography relies on the difficulty of solving the elliptic curve discrete logarithm problem.
3) Elliptic curve cryptography provides the same security level as other cryptosystems like RSA but with smaller key sizes, making it advantageous for applications with limited computational power or space.
Block ciphers encrypt fixed-length blocks of plaintext into ciphertext using symmetric keys. There are five modes of operation that allow block ciphers to encrypt messages longer than the block size: electronic codebook (ECB), cipher block chaining (CBC), cipher feedback (CFB), output feedback (OFB), and counter mode. These modes address issues like encrypting non-block-sized messages and adding randomness to prevent patterns in the ciphertext. ECB encrypts each block independently while the others use chaining or a counter to make each ciphertext block dependent on previous blocks. Initialization vectors are used to randomize encryption of identical plaintexts.
Elliptic curve cryptography uses elliptic curves over finite fields to provide security for encryption, digital signatures, and key exchange. The security of ECC relies on the difficulty of solving the elliptic curve discrete logarithm problem. ECC offers equivalent security to RSA and other systems using smaller key sizes, reducing requirements for storage, transmission, and processing. Implementation considerations include optimization of finite field and elliptic curve arithmetic for different computing environments and applications.
The document provides an introduction to data structures and algorithms. It begins with basic concepts like data, data types, data objects, and data structures. It then discusses different types of data structures like linear and non-linear, static and dynamic, and persistent and ephemeral data structures. The document also explains common data structures like arrays, stacks, queues, linked lists, trees and graphs. It provides examples to illustrate concepts like one dimensional, two dimensional and multi-dimensional arrays. Finally, it presents code examples to generate Fibonacci series using both iterative and recursive functions.
This document discusses laws, regulations, ethics, and professional organizations related to information security. It defines key concepts like laws, ethics, liability, due care and due diligence. Major sections cover relevant US laws, privacy laws, types of laws, and international legal issues. Professional ethics organizations and their codes are also summarized.
This document contains slides from a chapter on principles of information security. It discusses how laws are based on ethics, and different types of relevant laws in the US and other countries. These include privacy laws, copyright laws, and export/espionage laws. It also discusses ethics in information security, cultural differences, and professional organizations that promote ethics through codes of conduct and certifications. The role of education and deterrence to promote ethical behavior is covered.
IPSec provides security services like data integrity, authentication and confidentiality. It uses protocols like AH and ESP to implement these services in transport or tunnel mode. The IPSec architecture includes security policy and security association databases that define how security is applied to packets. SSL/TLS works above the transport layer, using a handshake protocol to authenticate parties and negotiate encryption, before applying its record protocol to provide message integrity and confidentiality. IDS/IPS systems monitor networks for malicious activity, generate alerts and reports. Signature and anomaly-based methods are used to detect known and unknown threats. IPS systems also aim to prevent detected threats from succeeding.
The document discusses stacks and their applications. It defines a stack as a Last In First Out (LIFO) data structure. Key stack operations are described such as push, pop, and peek. An array implementation of a stack is presented and applications like checking balanced brackets, converting infix to postfix notation, and postfix calculators are covered. Example code and diagrams are provided to illustrate stack concepts and operations.
The document discusses traversing a binary tree without recursion. It describes using an activation stack to simulate recursion by tracking the nodes to visit at each level of the tree. It provides pseudocode for in-order, pre-order and post-order traversal algorithms using an activation stack instead of recursion. It also covers inserting nodes into a binary search tree by recursively finding the correct location to add new nodes while maintaining the tree's search properties.
Charging and Fueling Infrastructure Grant: Round 2 by Brandt HertensteinForth
Brandt Hertenstein, Program Manager of the Electrification Coalition gave this presentation at the Forth and Electrification Coalition CFI Grant Program - Overview and Technical Assistance webinar on June 12, 2024.
Dahua provides a comprehensive guide on how to install their security camera systems. Learn about the different types of cameras and system components, as well as the installation process.
Top-Quality AC Service for Mini Cooper Optimal Cooling PerformanceMotor Haus
Ensure your Mini Cooper stays cool and comfortable with our top-quality AC service. Our expert technicians provide comprehensive maintenance, repairs, and performance optimization, guaranteeing reliable cooling and peak efficiency. Trust us for quick, professional service that keeps your Mini Cooper's air conditioning system in top condition, ensuring a pleasant driving experience year-round.
Charging Fueling & Infrastructure (CFI) Program Resources by Cat PleinForth
Cat Plein, Development & Communications Director of Forth, gave this presentation at the Forth and Electrification Coalition CFI Grant Program - Overview and Technical Assistance webinar on June 12, 2024.
Charging Fueling & Infrastructure (CFI) Program by Kevin MillerForth
Kevin Miller, Senior Advisor, Business Models of the Joint Office of Energy and Transportation gave this presentation at the Forth and Electrification Coalition CFI Grant Program - Overview and Technical Assistance webinar on June 12, 2024.
Charging Fueling & Infrastructure (CFI) Program by Kevin Miller
Ctutorial-Pointers 1.ppt
1. C Tutorial - Pointers
CS 537 – Introduction to Operating Systems
2. The Stack
• The stack is the place where all local
variables are stored
– a local variable is declared in some scope
– Example
int x; // creates the variable x on the stack
• As soon as the scope ends, all local
variables declared in that scope end
– the variable name and its space are gone
– this happens implicitly – the user has no
control over it
3. The Heap
• The heap is an area of memory that the
user handles explicitly
– user requests and releases the memory
through system calls
– if a user forgets to release memory, it doesn’t
get destroyed
• it just uses up extra memory
• A user maintains a handle on memory
allocated in the heap with a pointer
4. Pointers
• A pointer is simply a local variable that
refers to a memory location on the heap
• Accessing the pointer, actually references
the memory on the heap
5. Basic Idea
pointer
(on the stack)
data
(on the heap)
1200
starting address
of data
1216
ending address
of data
1200
6. Declaring Pointers
• Declaring a pointer is easy
– declared like regular variable except that an asterisk
(*) is placed in front of the variable
– example
int *x;
– using this pointer now would be very dangerous
• x points to some random piece of data
– declaring a variable does not allocate space on the
heap for it
• it simply creates a local variable (on the stack) that will is a
pointer
• use malloc() to actually request memory on the heap
7. malloc
• Prototype: int malloc(int size);
– function searches heap for size contiguous free bytes
– function returns the address of the first byte
– programmers responsibility to not lose the pointer
– programmers responsibility to not write into area past
the last byte allocated
• Example:
Memory
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Key
previously allocated
new allocation
char *ptr;
ptr = malloc(4); // new allocation
ptr
10
8. free
• Prototype: int free(int ptr);
– releases the area pointed to by ptr
– ptr must not be null
• trying to free the same area twice will generate an error
• Example:
initial memory
0 1 2 3 4 5 6 7
Key
allocated memory
free memory
free(ptr);
p1
5
0 1 2 3 4 5 6 7
after free
p2
2
p2
2
p1
null
9. Using a Pointer
• To access a piece of data through a pointer,
place an asterisk (*) before the pointer
– example
char *ptr = malloc(1);
*ptr = ‘a’;
if(*ptr == ‘a’) { … }
• Using the pointer without the asterisk actually
accesses the pointer value
– not the data the pointer is referencing
– this is a very common mistake to make when trying to
access data
10. sizeof() Function
• The sizeof() function is used to determine
the size of any data type
– prototype: int sizeof(data type);
– returns how many bytes the data type needs
• for example: sizeof(int) = 4, sizeof(char) = 1
– works for standard data types and user
defined data types (structures)
11. Simple Example
int main() {
1 int x, y;
2 int *z;
3 z = malloc(sizeof(int));
4 y = 5;
5 *z = 3;
6 x = *z + y;
7 free(z);
return 0;
}
Stack
Heap
y
x
z
1
2
3
108
108
5
3
8
4
5
6
12. Simple Example
1. Declare local variables x and y.
2. Declare local pointer z.
3. Allocate space on the heap for single integer. This step also
makes z point to that location (notice the address of the space on
the heap is stored in z’s location on the stack.
4. Set the local variable y equal to 5.
5. Follow the pointer referenced by z to the heap and set that
location equal to 3.
6. Grab the value stored in the local variable y and follow the pointer
z to grab the value stored in the heap. Add these two together and
store the result in the local variable x.
7. Releases the memory on the heap (so another process can use it)
and sets the value in the z pointer variable equal to NULL. (this
step is not shown on the diagram)
13. Common Mistakes
• Using a pointer before allocating heap space
int *ptr;
*ptr = 5;
• Changing the pointer, not the value it references
int *ptr = malloc(sizeof(int));
ptr = 10; // sets value on stack to 10, not value on the heap
• Forgetting to free space on the heap (memory
leak)
int *p1 = malloc(sizeof(int));
int *p2 = malloc(sizeof(int));
p1 = p2; // making p1 point to p2 is fine, but now you can’t free
// the space originally allocated to p1
14. Learning to Use Pointers
• DRAW PICTURES
– when first using pointers it is much easier to
draw pictures to learn what is happening
– remember that an asterisk (*) follows the
pointer
– no asterisk (*) refers to the actual pointer
variable on the stack
15. One More Example
#include <stdio.h>
#define MAX_LINE 80
int main() {
char *str = malloc(MAX_LINE * sizeof(char));
printf(“Enter your name: “);
scanf(“%s”, str);
printf(“Your name is: %sn”, str);
free(str);
return 0;
}
1
2
3
str
23
23
. . .
0 1 2 3 78 79
Stack
Heap
1
2
P a t 0
16. One More Example
1. In one line, declare the pointer variable (gets
placed on the stack), allocate memory on the
heap, and set the value of the pointer variable
equal to the starting address on the heap.
2. Read a value from the user into the space on
the heap. This is why scanf takes pointers as
the parameters passed in.
3. Release all the space on the stack pointed to
by str and set the value of the str pointer on
the stack equal to null. (step not shown)
17. Dereferencing
• Pointers work because they deal with
addresses – not value
– an operator performs an action at the value
indicated by the pointer
– the value in the pointer is an address
• We can find the value of any variable by
dereferencing it
– simply put an ampersand (&) in front of the
variable and you now have the address of the
variable
18. Revisiting scanf()
• Prototype: int scanf(char* str, void*, void*, …);
• What is void*?
– void* is similar to object in Java
– it can point at anything
• Since the data types being passed into scanf
can be anything, we need to use void* pointers
• If you want to scan a value into a local variable,
you need to pass the address of that variable
– this is the reason for the ampersand (&) in front of the
variable
19. scanf() Example
#include <stdio.h>
#define MAX_LINE 80
int main() {
char *student = malloc(char * sizeof(char));
int grade;
printf(“Enter student’s name: “);
scanf(“%s”, student);
printf(“Enter student’s grade: “);
scanf(“%d”, &grade);
printf(“%s received a %dn”, student, grade);
free(student);
return 0;
}
1
2
3
4
5
21. scanf() Example
1. In one line, declare the pointer variable (gets
placed on the stack), allocate memory on the
heap, and set the value of the pointer variable
equal to the starting address on the heap.
2. Create the local variable grade on the heap.
3. Read a value from the user into the space on
the heap – beginning at the address indicated
by the pointer variable on the stack.
4. Read a value from the user into the address
referred to by the address of grade.
5. Release all the space on the stack pointed to
by student and set the value of the student
pointer on the stack equal to null. (step not
shown)
22. Pointers and Functions
• One limitation of functions is that they only
return a single value
• So how to change multiple values in a
single function?
– pass in pointers
– now any changes that are made are made to
the address being referred to
– this changes the value for the calling function
as well as the called function
25. Example
1. Declare a pointer, f1, on stack.
2. Declare a pointer, f2, on stack.
3. Allocate space on the heap for a float and place the
address in the pointer variable f1.
4. Allocate space on the heap for a float and place the
address in the pointer variable f2.
5. Read values from the user. Hand scanf() the pointers
f1 and f2 and the data gets put on the heap.
6. Call the swap function. This pushes a new entry in the
stack. Copy the value of the pointers f1 and f2 into first
and second.
7. Create a new local variable tmp. Follow the pointer of
first and place its value into temp.
8. Follow the pointer of second, grab the value, follow the
pointer of first, place grabbed value there.
9. Grab the value from tmp, follow the pointer of second,
place the grabbed value there.
26. Lists
• Remember structures?
– structures together with pointers can be used
to make a list
• Some of the data in a structure will contain
the information being stored
• One of the fields in the structure will be a
pointer to the next structure in the list
27. Lists
• Example of a structure used in a linked list
struct list_node {
char letter;
struct list_node *next;
}
• The letter variable is the data to be stored
• The next variable will point at the next
element in the list
– or NULL if there are no more elements
30. Example
Stage 0: empty list
head
Stage 1: one element in list
struct list_node
word
next
hi
Stage 2: multiple elements in list
struct list_node
word
next
hi
struct list_node
word
next
at
head
head
31. 2-D Pointers
• To really make things confusing, you can have
pointers to pointers
– and pointers to pointers to pointers …
• This comes in handy whenever a 2-D array is
needed
– you can also declare 2-D arrays, but these go on the
stack
– if dynamic memory is needed, must use pointers
• Declaring a pointer to a pointer
– just put 2 asterisks (*) in front of the variable
– example
char **names;
33. argv
• Up until now, main has been written
– int main() { … }
• This is okay, but it’s usually written
– int main(int argc, char** argv) { … }
• argc
– number of command line arguments being passed in
• this counts the name of the program
• argv
– this is an array of strings – a 2-D character array
– each string represents one command line argument
34. Example
#include <stdio.h>
int main(int argc, char** argv) {
int i;
printf(“Number of arguments: %dn”, argc);
for(i=0; i<argc; i++)
printf(“argument %d: %s”, i, argv[i]);
return 0;
}
35. Example
• Given the following command line
prompt> example –o option required
• The output of the sample program
Number of arguments: 4
argument 0: example
argument 1: -o
argument 2: option
argument 3: required
37. Creating a 2-D Array
• Assume a 2-D array of characters is needed
– this is basically an array of strings
• Assume 4 strings with a max of 80 chars
int main() {
char** names;
int i;
names = (char**)malloc(4 * sizeof(char*));
for(i=0; i<4; i++)
names[i] = (char*)malloc(80 * sizeof(char));
for(i=0; i<4; i++)
free(names[i]);
free(names);
return 0;
}
1
2
3
4
5
6
38. 2-D Arrays
• Once you really understand this previous
example, you are well on your way to
understanding pointers
• Let’s take a closer look at exactly what is
going on
40. 2-D Arrays
1. Create a pointer on the stack that will point to a
group of pointers
2. Create a local variable on the stack
3. Make names point to an array of 5 pointers to
characters. This array is located on the heap.
4. Go through each pointer in the array and make
it point at an 80 character array. Each of these
80 character arrays is also located on the heap
5. Freeing each of the 80 character arrays. (not
shown on diagram).
6. Free the array of pointers. (not shown on the
diagram)