Similar documents
Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

Kapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8


Functions. Introduction :

Pointer Basics. Lecture 13 COP 3014 Spring March 28, 2018

C++ for Java Programmers

Pointers Pointer Variables. Pointer Variables Getting the Address of a Variable. Each variable in program is stored at a

Darshan Institute of Engineering & Technology for Diploma Studies

MEMORY ADDRESS _ REPRESENTATION OF BYTES AND ITS ADDRESSES

Lecture 14. No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions?

Exam 3 Chapters 7 & 9

DECLARAING AND INITIALIZING POINTERS

Pointer Data Type and Pointer Variables

Lecture 4: Outline. Arrays. I. Pointers II. III. Pointer arithmetic IV. Strings

Chapter 9: Pointers Co C pyr py igh i t gh Pear ea so s n n E ducat ca io i n, n Inc. n c.

Pointers, Dynamic Data, and Reference Types

Pointers. A pointer value is the address of the first byte of the pointed object in the memory. A pointer does not know how many bytes it points to.

9.2 Pointer Variables. Pointer Variables CS Pointer Variables. Pointer Variables. 9.1 Getting the Address of a. Variable

Syntax to define a Structure: struct structurename { datatype membername1; datatype membername2;... } ; For Example:

Output of sample program: Size of a short is 2 Size of a int is 4 Size of a double is 8

CS201- Introduction to Programming Current Quizzes

Homework #3 CS2255 Fall 2012

[0569] p 0318 garbage

C++ ARRAYS POINTERS POINTER ARITHMETIC. Problem Solving with Computers-I

Unit IV & V Previous Papers 1 mark Answers

Pointer Arithmetic. Lecture 4 Chapter 10. Robb T. Koether. Hampden-Sydney College. Wed, Jan 25, 2017

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Fri, Jan 18, 2013

What is an algorithm?

MODULE 3: Arrays, Functions and Strings

Scott Gibson. Pointers & Dynamic Memory. Pre & Co Requisites. Random Access Memory. Data Types. Atomic Type Sizes

Outline. Computer Memory Structure Addressing Concept Introduction to Pointer Pointer Manipulation Summary

Pointers. Lecture 2 Sections Robb T. Koether. Hampden-Sydney College. Mon, Jan 20, 2014

CSC 211 Intermediate Programming. Arrays & Pointers

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example:

Lecture 8: Pointer Arithmetic (review) Endianness Functions and pointers

calling a function - function-name(argument list); y = square ( z ); include parentheses even if parameter list is empty!

FORM 1 (Please put your name and section number (001/10am or 002/2pm) on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each):

Chapter 9: Pointers. Copyright 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved.

Chapter 9: Getting the Address of a Variable. Something Like Pointers: Arrays. Pointer Variables 8/23/2014. Getting the Address of a Variable

Solution: A pointer is a variable that holds the address of another object (data item) rather than a value.

Pointers. Part VI. 1) Introduction. 2) Declaring Pointer Variables. 3) Using Pointers. 4) Pointer Arithmetic. 5) Pointers and Arrays

Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

CS 161 Exam II Winter 2018 FORM 1

OOP THROUGH C++(R16) int *x; float *f; char *c;

Downloaded from

What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable.

Pointers. Memory. void foo() { }//return

Pointers as Arguments

C Pointers. Indirection Indirection = referencing a value through a pointer. Creating Pointers. Pointer Declarations. Pointer Declarations

Pointers. Variable Declaration. Chapter 10

C: Pointers. C: Pointers. Department of Computer Science College of Engineering Boise State University. September 11, /21

CS31 Discussion 1E Spring 17 : week 08

Language comparison. C has pointers. Java has references. C++ has pointers and references

CS31 Discussion. Jie(Jay) Wang Week8 Nov.18

What have we learned about when we learned about function parameters? 1-1

CS2255 HOMEWORK #1 Fall 2012

UEE1302 (1102) F10 Introduction to Computers and Programming (I)

by Pearson Education, Inc. All Rights Reserved.

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

a data type is Types

Pointers. Lecture 1 Sections Robb T. Koether. Hampden-Sydney College. Wed, Jan 14, 2015

Dynamic Allocation of Memory

Introduction to Scientific Computing and Problem Solving

EM108 Software Development for Engineers

REFERENCES, POINTERS AND STRUCTS

Lecture 2: C Programm

FORM 2 (Please put your name and form # on the scantron!!!!) CS 161 Exam II:

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

Pointers. 1 Background. 1.1 Variables and Memory. 1.2 Motivating Pointers Massachusetts Institute of Technology

PROGRAMMAZIONE I A.A. 2017/2018

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

Pointers and Dynamic Memory Allocation

Pointers and Strings Chapters 10, Pointers and Arrays (10.3) 3.2 Pointers and Arrays (10.3) An array of ints can be declared as

Downloaded S. from Kiran, PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from

Parameter passing. Programming in C. Important. Parameter passing... C implements call-by-value parameter passing. UVic SEng 265

Week 3: Pointers (Part 2)

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures

CA31-1K DIS. Pointers. TA: You Lu

CHAPTER 4 FUNCTIONS. 4.1 Introduction

Chapter 7 C Pointers

Agenda. Peer Instruction Question 1. Peer Instruction Answer 1. Peer Instruction Question 2 6/22/2011

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C

EL2310 Scientific Programming

CSC 211 Intermediate Programming. Pointers

Pointers. Pointers. Pointers (cont) CS 217

Chapter 11: Pointers

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018

COMPUTER SCIENCE (083)

Chapter 11: Structured Data

C Pointers. 6th April 2017 Giulio Picierro

POINTERS, STRUCTURES AND INTRODUCTION TO DATA STRUCTURES

Lab 3. Pointers Programming Lab (Using C) XU Silei

CSCI-1200 Data Structures Fall 2017 Lecture 5 Pointers, Arrays, & Pointer Arithmetic

POINTER & REFERENCE VARIABLES

FORM 2 (Please put your name and form # on the scantron!!!!)

Pointer in C SHARDA UNIVERSITY. Presented By: Pushpendra K. Rajput Assistant Professor

Chapter-13 USER DEFINED FUNCTIONS

CE221 Programming in C++ Part 2 References and Pointers, Arrays and Strings

C++ Memory Map. A pointer is a variable that holds a memory address, usually the location of another variable in memory.

To declare an array in C, a programmer specifies the type of the elements and the number of elements required by an array as follows

Transcription:

POINTERS INTRODUCTION: A pointer is a variable that holds (or whose value is) the memory address of another variable and provides an indirect way of accessing data in memory. The main memory (RAM) of computer consists of bytes which are numbered sequentially. Each byte is numbered [i.e. from 0 to (n-1)] and this number is its address. When we declare a variable, we mention its type and its name, and the compiler along with operating system allocates a block of memory for storing the value of the variable. Generally, the address of a variable is the address (byte number) of the very first byte of the memory block allocated to the variable. This address is known as base address. While programming, a programmer doesn t knows what address is to be allocated by the compiler to a variable. However, C++ provides address-of operator (&), also called reference operator to retrieve the address of a variable. For instance, if n is an integer variable, its address (i.e. address of the first byte, also called base address) is given by &n. We may declare another variable for storing &n, which is the address of n. That variable is called pointer to n. 1020 1020 p is a pointer to n p (pointer variable) n --------------------------------------------------------------------------------------------- POINTERS : DECLARATION AND INITIALIZATION A pointer variable can be declared as follows: type *ptrvarname; The operator (*) tells the compiler that the variable name on its right is a pointer and is going to store a memory address. int *iptr; // pointer to an integer char *cptr; // pointer to a character float *fptr; // pointer to a floating point number. Page 21

Initializing a pointer (Creating a Link): Like any other variable, a pointer variable must also be initialized before using it. Pointers may be initialized to an address or otherwise to 0 or NULL, which is a symbolic constant. NULL is defined in header file iostream.h and other C++ header files like stddef.h. It is equivalent to 0. A NULL pointer does not point to any valid data. A pointer variable can be initialized as follows: ptrvarname=&variable; iptr=&a; cptr=&ch; fptr=&f; // assuming a is declared as a variable of type int. // assuming ch is declared as a variable of type char. // assuming f is declared as a variable of type float. The pointer variable can be declared as well as initialized in a single line as follows: type *ptrvarname=&variable; int *iptr = &a; char *cptr = &ch; float *fptr = &f; --------------------------------------------------------------------------------------------- Indirection or Dereference Operator: The value of a variable may be obtained from its pointer by using indirection operator also called dereference operator (*). It is called indirection because it obtains the value indirectly. int n = 5, *iptr ; iptr = &n ; *iptr = 60; // read as value at address iptr is 60; this expression makes the value of n as 60. In this way pointers may be used in place of the variables they point to. --------------------------------------------------------------------------------------------- NOTE: i) The pointer variables must always point to the correct type of data. Making a pointer point to incorrect type of data may lead to loss of information. float f; int *ptr; cin>>f; ptr=&f; // NOTE pointer ptr is of type int and is initializing it with the address of a float point value. ii) A pointer variable must not remain uninitialized since uninitialized pointers cause the system crash. To avoid this problem, initialize such pointers with NULL. Page 22

iii) NULL Pointer: A NULL Pointer is a regular pointer of any pointer type which has a special value that indicates that it is not pointing to any valid memory address. int *p=null; (OR) int *p=0; iv) In pointer arithmetic, all pointers increase or decrease by the length of the data-type they point to. int a; // Suppose address of a is 1020 int *iptr=&a; iptr++; // iptr now points to 1022 instead of 1021 iptr+=3; // iptr now points to 1028 instead of 1025 iptr iptr+1 iptr+2 iptr+3 iptr+4 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 Fig: To illustrate all pointer arithmetic is relative to its base type. v) The pointers to two or more variables of same type may be declared in the same line. int m, n, *m, *n; m=&m; n=&n; vi) A pointer variable itself is allocated 4-bytes of memory space (on 32-bit systems) to store the memory address irrespective of the fact whether the variable to which it points to is integer, double or character. The following program illustrates this: int main() int n = 6,*iptr; double PI = 3.14,*fptr; fptr = &PI; iptr = &n; char ch = 'M',*cptr; cptr = &ch; // initializing by &ch cout<< "Size of the pointer to int n = " <<sizeof(iptr)<<endl; cout <<"Size of the pointer to double PI = "<<sizeof(fptr)<<endl; cout<< "Size of the pointer to char ch = "<<sizeof(cptr) <<endl; cout<<"variables are "<<*iptr <<", "<<*fptr<<" and "<<*cptr<< endl; return 0; Page 23

OUTPUT: Size of the pointer to int n = 4 Size of the pointer to double PI = 4 Size of the pointer to char ch = 4 Variables are 6, 3.14 and M vii) POINTER TO POINTER: Just like we have a pointer to a variable, we can also define a pointer to a pointer which keeps the address of the pointer to the variable. int*iptr = &n ; int** pptr = & iptr ; // iptr is pointer to n // pptr is pointer to iptr Note that both for pointer and pointer to pointer, the type is int because n is integer. Also note that for getting the value of variable, we use one dereference operator (*) to pointer while for getting the value of variable from pointer to pointer, we have to use two dereference operators (**). This situation is called multiple indirection. But there is no change in the application of address-of operator (&). viii) CONSTANT POINTERS: The attribute modifier const may be used with pointers as well. However, the declaration should be done carefully keeping in view the following: const int* ptr ; int* const ptr ; const int* const ptr ; // Here ptr is a non-constant pointer to a constant int. // Here ptr is a constant pointer to a non-constant int. // Here ptr is a constant pointer to a constant int. ------------------------------------------------------------------------------------------------------------------------------- POINTER TO ARRAY: [1-D array] Arrays and Pointers are very closely linked in C++ and may be used almost interchangeably. C++ treats the name of an array as a constant pointer that always point to the first element of the array; and the pointer to array also carries the address of the first element of the array. Thus the pointer to an array has same value as the name of the array. The declaration of a pointer to an array is illustrated below: int A[] = 12, 25, 36,50; // A is the name of array int *ptra ; // pointer ptra of type int declared ptra = A ; // assigns address of array A to ptra; Notice there is no & operator before A. The above definition may also be written as below: int *ptra = A; This is equivalent to taking the address of the first element of the array as follows: int *ptra = A[0]; // It is so because the address of A[0] is same as of A. Page 24

C++ provides two methods of accessing array elements: array indexing and pointer arithmetic. The elements of the above array A[0], A[1], A[2], and A[3] have respective values as 12, 25, 36 and 50 which may also be obtained from pointers as illustrated below: Pointer *ptra *(ptra+1) *(ptra+2) *(ptra+3) arithmetic 12 25 36 50 Array indexing A[0] A[1] A[2] A[3] The above discussion shows that array subscript and pointer offset are equal. If we call array A without a subscript, it will give the address of first element of array. A +1 gives the address of second element, A+2 gives address of third elements and so on. Therefore, we can also get the values stored at these addresses by using dereference operator (*). Thus for the above declared array we may get the values of array elements as given below: *A = A[0] = 12 *(A+1) = A[1]= 25 *(A+2 )= A[2]= 36 *(A+3) = A[3]= 50 Note that expression *A++ is not legal because A is a constant pointer to array and a constant cannot be incremented/decremented. Program to Illustrate declaration of pointer to an array: int main() int A [] = 12, 25, 36,50; int *ptra = A; // A is an array of integers //ptra is pointer to A. Note that & is not used. cout<<"*ptra ="<<*ptra <<"\t ptra ="<<ptra<<endl; cout<<"*(ptra+1)="<<*(ptra+1)<<"\t ptra+1="<<(ptra+1)<<endl; cout<<"*(ptra+2)="<<*(ptra+2)<<"\t ptra+2="<<(ptra+2)<<endl; cout<<"*(ptra+3)="<<*(ptra+3)<<"\t ptra+3="<< (ptra+3)<<endl<<endl; cout<<"a = "<< A<<endl; cout<<ptra[0]<< \t <<ptra[1]<< \t <<ptra[2]<< \t <<ptra[3]<<endl; cout <<*(A+0)<< \t <<*(A+1)<< \t <<*(A+2)<< \t <<*(A+3)<<endl; // These will display the values of array elements. return 0; Page 25

The expected OUTPUT is as below: *ptra =12 ptra =0x225f2450 *(ptra+1)=25 ptra+1=0x225f2452 *(ptra+2)=36 ptra+2=0x225f2454 *(ptra+3)=50 ptra+3=0x225f2456 A = 0x225f2450 12 25 36 50 12 25 36 50 ------------------------------------------------------------------------------------------------------------------------------- ARRAY OF POINTERS: Similar to other variables, we can create an array of pointers in C++. The pointers may be arrayed by declaring a pointer array of specific type and then assigning each element of the pointer array by the addresses. type *pointerarrayname[size]; Ex. An array holding 6 integer pointers can be declared as: int *p[6]; // declares an array P that can hold 6 int pointers After this declaration, contiguous memory would be allocated for 6 pointers that can point to integers. To assign the address of an integer variable called var to the third element of the pointer array, we may write: p[2] = &var; To get the value of that var, we can write : *p[2] The following program illustrates this: int main() int *p[6]; int a=11,b=22,c=33,d=44,e=55,f=66; p[0]=&a; p[1]=&b; p[2]=&c; p[3]=&d; p[4]=&e; p[5]=&f; cout<< "THE VALUES ARE:\n"; for(int i=0;i<6;i++) cout<<*p[i]<<"\t"; cout<< \nthe size of p is: <<sizeof(p); cout<< \nthe size of (p[0]) is: <<sizeof(p[0]); cout<< \nthe size of (p[1]) is: <<sizeof(p[1]); Page 26

cout<< \nthe size of (*p[0]) is: <<sizeof(*p[0]); cout<< \nthe size of (*p[1]) is: <<sizeof(*p[2]); return 0; The expected OUTPUT is as below: THE VALUES ARE: 11 22 33 44 55 66 The size of p is: 24 The size of (p[0]) is: 4 The size of (p[1]) is: 4 The size of (*p[0]) is: 2 The size of (*p[1]) is: 2 POINTERS AND STRINGS: [storing several strings in the memory] We know that a string is a one-dimensional array of characters, which start with the index 0 and ends with the null character \0. C++ also allows us to handle strings with pointers, simply called string array. Each entry in the array is a string, but in C++ a string is essentially a pointer to its first character, so each entry in an array of strings is simply a pointer to the first character of a string. Consider the declaration of string array pstr that might be useful in representing different subjects: char *pstr[ 4 ] = "PHY", "CHEM", "MATHS", "BIO" ; The pstr[4] portion of the declaration indicates an array of four elements. The char * portion of the declaration indicates that each element of array pstr is of type "pointer to char. Although it appears that these strings are being placed in the pstr array, only pointers are actually stored in the array, as shown in figure below. Each pointer points to the first character of its corresponding string. Thus, even though the pstr array is fixed in size, it provides access to character strings of any length. This flexibility is one example of C++'s powerful data-structuring capabilities. pstr[0] pstr[1] 1020 2020 P 1020 C 2020 H 1021 H 2021 Y 1022 E 2022 \0 1023 M 2023 \0 2024 pstr[2] pstr[3] 3020 4020 M 3020 B 4020 A 3021 I 4021 T 3022 O 4022 H 3023 \0 4023 S 3024 \0 3025 pstr[ ] array Page 27

Program to Illustrate string pointer pointing to several strings: void main() char *pstr[]= "PHY", "CHEM", "MATHS", "BIO" ; for(int i=0;i<4;i++) cout<<pstr[i]<<"\t"; cout<<&(pstr[i])<<"\t"; cout<<"size of (pstr[i]): "<<sizeof(pstr[i])<<endl; cout<<*pstr[i]<<"\t"; cout<<&(*pstr[i])<<"\t\t"; cout<<"size of (*pstr[i]): "<<sizeof(*pstr[i])<<"\n\n"; The expected OUTPUT is as below: PHY 0x24cf241c size of (pstr[i]) : 4 P PHY size of (*pstr[i]): 1 CHEM 0x24cf2420 size of (pstr[i]) : 4 C CHEM size of (*pstr[i]): 1 MATHS 0x24cf2424 size of (pstr[i]) : 4 M MATHS size of (*pstr[i]): 1 BIO 0x24cf2428 size of (pstr[i]) : 4 B BIO size of (*pstr[i]): 1 Note: we cannot perform pointer arithmetic in the above program as array elements (of the array pstr) are not stored in contiguous memory locations. ------------------------------------------------------------------------------------------------------------------------------- POINTERS AND FUNCTIONS: We know that a function is a user defined operation that can be invoked by passing the values of arguments (call by value method) or references to arguments (call by reference method). The call by reference method can itself be used in two ways: by passing references by passing the pointers Page 28

Invoking functions by passing the pointers: When the pointers are passed to the function, the addresses of actual arguments in the calling function are copied into the formal arguments of the called function. i.e. in the function-call statement, we have to pass addresses of actual arguments. Thus, the called function doesn t create its own copy of original values, rather, it refers to the original values by the addresses it receives in corresponding pointers. The declaration of a function (Function Prototype) that is invoked by passing pointer looks like: return-type functionname( type*, type*,... ); Ex: Program to swap values of two variables by passing pointers void main() void swap(int*, int*); int a=10,b=20; cout<<"original values are:"<<endl; cout<<"a="<<a<<"\t b="<<b; swap(&a,&b); // prototype // function call cout<<"\nvalues after swapping are:"<<endl; cout<<"a="<<a<<"\t b="<<b; Here, pointers x and y are are initialized with &a and &b resp. i.e. *x=&a, *y=&b void swap(int *x, int *y) int temp; temp=*x; *x=*y; *y=temp; // function definition The OUTPUT of the program is as below: original values are: a=10 b=20 values after swapping are: a=20 b=10 Page 29

Functions returning pointers: Like any other data-type, a function may also return a pointer. The general form of prototype of a function returning a pointer would be type *functionname(argument-list); where type specifies the pointer type being returned by the function specified by functionname Program to illustrate a function returning a pointer: void main() int *bigger(int*, int*); // prototype int a,b,*big; cout<<"enter two integers:"<<endl; cin>>a>>b; big= bigger(&a, &b); // function call cout<<"\nthe bigger value is:"<<*big; int *bigger(int *x, int *y) if(*x>*y) return(x); else return(y); // note that return(x) is same as return(&x) The OUTPUT of the program is as below: Enter two integers: 4 9 The bigger value is:9 Page 30

POINTERS TO STRUCTURES: Just like pointers to any other data-type, C++ also allows pointers to structures. The pointers to structures are also known as structure pointers. The general form of declaration of a structure pointer is as follows: structname *structpointer; where structname is the name of an already defined structure and structpointer is the pointer to this structure. struct stu int rollno; char name[20]; float marks; ; void main() stu s1=1, "mohan", 76,*pstu; // declaration pstu=&s1; // initialization cout<<"the details of S1 are:"<<endl; cout<<pstu->rollno<<"\t"<<pstu->name<<"\t"<<pstu->marks; The OUTPUT of the above program is: The details of S1 are: 1 mohan 76 Note that the members of structures are accessed either by using dot operator (.) and using the arrow operator (->). Accessing members of structures using dot operator (.) using the arrow operator (->) in case of structure pointers s1.rollno; s1.name; s1.marks; pstu-> rollno; pstu->name; pstu->marks; Page 31

Self-Referential Structures: A structure having a member element that refers to the structure itself is known as selfreferential structure. For Example: struct stu int rollno; char name[20]; float marks; stu *next; ; // *next is referring to the structure stu itself In the above example, * next is referring to the structure stu itself. It is useful in defining linked lists wherein each element points to the next element of same type. ------------------------------------------------------------------------------------------------------------------------------- POINTERS AND OBJECTS: C++ also allows us to have pointers to objects. The pointers pointing to objects are referred to as object pointers. The general form of declaration of an object pointer is as follows: classname *objectptr; where classname is the name of an already defined class and objectptr is the pointer to an object of this class type. student s1; // s1 is an object of class student s1 *optr; // optr is the object pointer. Accessing public members of a class By using dot operator (.) in case by using the arrow operator (->) while accessing the class members in case while accessing the class using an object members using an object pointer. s1.getdata(); s1.display(); optr-> getdata(); optr -> display(); Page 32

Consider the program : #include<string.h> class stu int rollno; char name[20]; float marks; public: void getdata(int r, char n[], float m) rollno=r; strcpy(name,n); marks=m; void display() cout<<rollno<<"\t"<<name<<"\t"<<marks; ; void main() stu s1; stu *optr=&s1; // object pointer declared & initialized optr->getdata(1, "rohan", 76); cout<<"the details of object S1 are:"<<endl; optr->display(); The OUTPUT of the above program is: The details of object S1 are: 1 rohan 76 Page 33

this POINTER The this pointer is an object pointer which points to the currently calling object. It stores the address of the object that is invoking a member-function. The this pointer is, by default, available to each called member-function. Following example illustrates this: Consider the program : #include<string.h> class stu char name[20]; public: stu(char *n) Note that this can be used only within a member function and it stores the address of the calling object strcpy(name,n); void display() cout<<this->name<<endl; // here, cout<<this->name has the same effect as cout<<name ; void main() stu s1("sohan"), s2("rohan"), s3("mohan"); s1.display(); s2.display(); s3.display(); The OUTPUT of the above program is: sohan rohan mohan The this pointer is useful in returning the object (address) of which the function is a member. ------------------------------------------------------------------------------------------------------------------------------- Page 34