 So, good morning everybody and welcome back to the post T session. As I promised before carrying on with the examples and interaction, we would go back to the pointer example and have our first quiz. I hope all of you are ready with clickers in your hands. So, here is the quiz. Here was the pointer example and in the pointer example to recapitulate briefly, we had said that we have m, n and 3 element array a which was float, m and n were integers. We declared two pointers p and q, p representing integer and q representing float. We went through the assignment operation of pointers to addresses p equal to and m and n equal to star p saying that the number n that is printed out will be exactly 5 as m was because m gets assigned to n. In the second case, we said a 0 is 15.5, q is equal to and a 0 and q plus plus. Now, if we look at the next set of statements, star q is assigned 25.0, again I have q plus plus and star q is assigned a 1 plus 10. Notice that here we are actually doing pointer manipulation and we are using q plus plus to add increment the pointer put num f, put num f a 2 a 1 will tell us the values and we have seen that the values that we get are 25 and 35 for a 1 and a 2 which are the correct values as we would like them to have. However, the doubt that we have is that we are saying q plus plus here is that the correct statement. So, the quiz is about that I am now displaying the quiz question here in the about program we have star q equal to 25, q plus plus and star q equal to a 1 plus 10. Since a is float each element is 4 bytes long yet we are simply saying q plus plus. Our understanding of a plus plus operator is that it adds 1 to the contents. So, q plus plus should be advancing the value of q by 1, why does then the program work correctly? Here are the four options, a it actually does not, the next element happens to have a value 35.0, b q plus plus always adds 4 to q because the size of q is 4 bytes. d q refers to a float type data compiler knows that float occupies 4 bytes hence the instruction q plus plus is translated to add 4 to q and d none of the above. So, this is the quiz you already explained the quiz they are the actual answers a b c d I would request you to enter quiz number 10 coordinator should do that quiz number 10 and collect responses I will wait for exactly 1 minute from this point 15 seconds small for you to type your final answer. Remember that if you are not press lock then you can still choose to respond differently. Time is up now I will collect responses we have received responses from Surat, Ahmedabad, Bangalore, Amrita column, Trichur received from Surat Somaiya Vidyavihar, MGM Nanded and Amrita Koyam tour. We have now some more we have Amrita Bangalore, Nirmah, Ahmedabad and we have we already had MGM Nanded or College of Engineering Pune. So, we have 1, 2, 3, 4, 5, 6, 7, 8 and 9 centers may be we will wait for a minute or so to check whether the FTP comes. In the meanwhile let me explain to the participants that the responses that you gave were actually instantly collected by the receiver sitting in the same hall as you are sitting and that receiver is supposed to have created a XML file and that XML file contains individual responses that to the clicker IDs and those responses in that file that file is supposed to be automatically transmitted to a central location here through an FTP protocol. What happens sometimes is that if the machine connected to network at your end sits behind a firewall or sits behind a proxy server perhaps the FTP connection does not get automatically executed. We had the same problem here in IIT what we have done is we have got permission from IIT network to create a connection which goes without the IIT Bombay firewall. Actually has other situation from security point of view but we got a special permission and subsequent workshops will actually set up a completely independent network so that we can go out. Similar things will have to be done by different centers. Can we refresh it once again? We have received from IIT Surat Kal 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5. Incidentally for those centers which have actually received but are unable to transmit file we have said IIT Surat Gujarat is having a query. Can we go over to IIT Surat and then come back again? Yes sir I am Sonal from IIT Surat actually we wanted to ask is in which language the compiler is developed? Which language? First C compiler in which language first C compiler was developed? But the first compiler was written in the assembly language of a machine called PDP-7. In fact the Unix operating system was first developed in the assembly language of that computer then C language compiler was developed in that assembly language and once the C compiler was developed C was used again to rewrite the Unix operating system. So it was the first example problem in the world where an operating system was written in a higher level language and subsequently almost all operating systems are now written in C or C derivatives. Sonal college has a query let us just go over to Sonal college. Good morning. Yes please go ahead don't wait. Sir what is the need for using pointers to arrays when arrays itself as like a pointer for doing the subject elements? This is a question lady I have been asking all my programmer friends for last so many years. Ordinarily there should be no need for us to use pointers and that is what I explained that the examples that I have constructed are artificial although most C programmers tend to use pointers very heavily. I wonder whether they stop and think whether the pointer usage is absolutely essential or not. However you will soon find in our discussions the actual need for the pointers very specifically when you pass structures and when you pass functions you will find that passing large structures without passing pointers would be counter productive in terms of very heavy work that is to be done specially if the structure has very huge amount of data. There are these and similar instances where pointers are absolutely dictated or mandated because of the efficiency. Professor Kannan is sitting in Pune. So let us very briefly go over to Pune and say hello to him. Hello Professor Patak. Yeah I came to so this visit here is unexpected. Rather my visit to Pune today was well planned but I was not planning to come here. Only occurred to me this morning. Why not visit the nearest college and see if I can see how the participants are. I came to MIT COE in the morning. I gave inaugurated a Psylab workshop and then after the workshop somebody else is giving a one hour talk and MIT COE is just about 15 minutes from the model colony where this symbiosis center is at. So I am at symbiosis. I can hear you very well. Your videos also is coming really well. I thought I would also interact with you through this facility from Pune and also talk to the participants here. That is the reason why I came here. Thank you Professor Kannan. In fact I wish that other senior leaders in sister organizations such as ISRO, MHRD are able to over the next three days at least come and say hello to the participants and see how the workshop is going. I believe we have established these 650 all attending participating colleague teachers and the 22 center coordinators and their staff have achieved a great first in the country for which I would also like to compliment all of them. So let us get back to the quiz now. Here we have on the display the quiz results will now view all the responses. So this is the response chart. I wish my clicker team converts that from student response to participant response because my colleague 650 teachers were sitting there and not exactly students. But I hope people do not mind because ultimately all of us teachers are perpetual students of the subject that we teach. So I believe that is okay. Let me see. Does it tell me the numbers by the way? Yes sir. Okay. So on the left hand side I can see the numbers. Now this reminds me exactly of the Konbanega Karodpati audience poll where the correct answer has maximum respondents but there are non-zero responses for other answers as well. So A has about five responses. B has about nine responses and D has one response. Now let me just go back to the actual query. If this is the query, notice that we have several responses for B, large number of responses for C and a very few for A and D. Actually A is not correct because the next element may not have a value of 35. In fact if this is the correct answer this can be cross-checked by simply running the program many times because if you run the program many times then every time the value in the next location will not happen to be 35 and if it consistently gives you 35 it should clarify that this cannot be the correct answer. So if students give these answers this is the explanation we can give to them because this can be empirically proven. However it is not the correct answer because there is a correct answer in this set. Option B says Q plus plus always adds 4 to Q because the size of Q is 4 bytes. Please note that the size of Q merely determines the total number of unique locations Q can address. Therefore the size of Q has nothing to do with what value is there inside the Q and with what value that value should be incremented. Therefore the incrementing of the value of Q has nothing to do with size of Q and that is why the answer B is wrong. Answer D is wrong because as I said there is a correct answer and indeed C is the correct answer. Let us analyze this correct answer. Q refers to float type data. Compiler knows that a float occupies 4 bytes. Hence the instruction Q plus plus is translated to add 4 to Q. It is important that we choose this wording. We cannot say that Q is incremented by 1 means that Q is incremented by 4. Nothing of that sort can automatically happen. Now who does this translation? The translation of all our instruction is done by the compiler. Ordinarily if I say n plus plus or i plus plus or j plus plus or i equal to i plus 1 or j equal to j plus 1 all these mean to us increment value of i or j or m by 1. That is because the compiler translates this into an increment instruction for the associated variable and that increment is increment by 1. In case of Q that must not happen because Q is a pointer which refers to a floating point value. Now the compiler knows already that Q refers to a floating point value which is 4 bytes long. Remember that is the reason why it is very very important to associate a type with Q. Suppose Q was a pointer to a short int then the short int occupies 2 bytes. If Q was a pointer to a double then a double occupies 8 bytes and consequently the increment to Q although we incremented by 1 the increment must happen either of 2 or of 8 depending upon whether it is shorted or whether it is double. Because the underlying data type is float and float occupies 4 bytes the Q value actual value must be incremented by 4. Ordinarily Q plus plus I will repeat if Q was a ordinary variable Q plus plus would always be translated by the compiler in an instruction which increments Q by 1. But because Q is a pointer the compiler behaves intelligently and the machine instruction it generates it will not add 1 to Q but it will add actually the size of float to Q. So in our program we seemingly incremented by 1 but what it means is next location of that type and the 1 is to be interpreted in that sense only. However the actual increment is always by the size of the underlying data type which happens to be 4. I would like to notice that from amongst us many of us had perhaps some doubt about it. Therefore it is only correct to assume that many of the students when we teach them pointers should have similar doubts in fact some of them will be convinced that whenever we say Q plus plus the pointer increments only by 1. It is therefore important that when we teach pointer we dispel this doubt perhaps by giving a similar example. This is the reason why I constructed this example to illustrate the point. The other point that has been proven is that we have for the first time collected for an online quiz responses from as many as 12 centres online and I am sure that the remaining centres we will get the files in due course of time. Tomorrow I shall report to you just for the sake of interest how many actual XML files we are able to collect and how many responses we have got. Imagine once we perfect this technology then for all subsequent 12 workshops that we propose to conduct under this mission we will be actually be able to say which participant responded to which query rightly or wrong. In case of teachers it is not very important whether the answer is right or wrong but it is important to note that people have thought and responded and of course they clarify their doubt. However in case of students it is important to collect that response and store that value because we may be able to use that value for the actual evaluation. I will just mention once again that such a speedy evaluation of student response is not possible in any conventional means. So thank you very much clicker team and thank you all the centre coordinators for having done fantastic work to actually make this particular clicker idea work and I am sure that within the next 3 days itself we will have an increasingly better response in terms of number of participants responses being collected and of course by the next workshop we would have sorted out all the problems. There is a question from PSG college how scan and printer function operate with different arguments are passed if there is any overloading. Very good question but this is not a question pertinent to C programming language. Please note that operator overloading is a notion of object oriented programming languages which for example is C++. In traditional C there is no notion of operator overloading and therefore even if some smart students who have read ahead of the syllabus ask you this question you must tell them that this question is not relevant in the context of C programming. However independently to the individual students you may try to satisfy the query but for which you have to go into the notions of operator overloading which requires actually a fairly elaborate discussion for the students. So we will pass that. There was one more question from somewhere question from NIT Surat. Sir my question will belong to the yesterday class. In yesterday you have said that all the memory variables of the program is located consecutive phases. I want to know sir that it happens always or in some cases non consecutive memory may be also located. So let me repeat this question and answer. The question is whether the allocation of memory is always to consecutive locations or sometimes it could be to non consecutive locations. So the answer to this is firstly this behavior has nothing to do with programming language or programming concepts. As a matter of fact our answer to such queries of the students should be that it does not simply matter. All that it matters is that whatever be the variables and arrays that I have declared in my program they are properly allocated memory somewhere. However the question whether they are allocated consecutive memory or not becomes relevant when we try to use pointers. Suffice it to say then in answer to such a query that as far as arrays are concerned array elements are always allocated consecutive memory and that is the reason why I can use pointer arithmetic to access individual successive elements of the array. Whether the individual other variables and different arrays are allocated consecutive memory or not will depend on the compiler. In almost all cases the compiler will try to allocate memory in a consecutive fashion. The correct answer is slightly requires us to go slightly into depth. For example there is a notion of scope there are certain variables which are declared for the full scope of the function that we write. There are certain external variables there are also certain variables which are declared within the scope of a for loop or a while loop. Since the scoping rules are different compiler might want to have a different strategy for handling these things. Memory variables in one function and memory variables in another function may not necessarily occupy consecutive positions one after another. So in a nutshell the answer is by and large the compiler will allocate memory in successive locations to different variables. There are two exceptions one when the compiler chooses to do so differently because of compulsions such as scoping rules. The second is that if I have defined a structure then there might be a need depending upon the machine architecture to put some bytes blank. These are called filler bytes if the word boundaries which are inherent property of the machine architecture crossover. For example suppose I have a three byte character string now I allocate three bytes to it. Next is a float and the float will take fourth, fifth, sixth and seventh line. But suppose the machine architecture requires that floating point numbers should always be allocated memory the starting point of which is divisible by four. Then I cannot start it on the fourth byte I have to start it on the fifth byte or if 0 was the first address 0 1 2 3 is occupied by the character string byte 4 must be 0 1 2 is occupied by the three bytes of character string and byte number 3 which is actually the fourth byte cannot start a floating point in which case the compiler either might do a jugglery of fitting a one character variable from somewhere else there or it might simply leave that as a blank. Such blank bytes in between are called padding bytes. This is entirely a compiler feature and the correct answer to your student should be that while such things may happen please don't worry about them as long as the memory is allocated properly to all your variables in arrays please do not worry at the most some bytes may go free and not utilize but it does not really matter in modern times to immediately follow this up I would like to take up the simple demonstration of a structure most of you would be familiar with the structures but this example is constructed to demonstrate how exactly structures can be used in our program. So suppose as I said if I want to combine information which is seemingly belonging to different data types yet the totality of the information is not disparate but it is all concerned with a particular type of object or entity. So here is an example suppose I want to store information about students now a student has a name which may be 30 character long a student may have a roll number which may be 8 characters long a student may be staying in some hostel depending upon the hostel naming scheme for example in IIT all hostels are numbered so we have 13 hostels starting from 1 2 3 4 5 6 and so on and these are integer numbers then there are marks and the marks could be in say 2 3 4 5 or 8 different categories for example each student will get marks in a quiz each student will get marks in one or more assignments each student will get marks in mid semester in end semester in project so if there are 5 categories of marks then I would like to record 5 different marks for each student and therefore I may need an array which is described here as float marks 5 finally there may be a 3 character grade so we have 2 character grades here such as a a a b b c etc etc the 2 character grade is stored in a 3 element array because you remember that string must have a terminating backslash null so consequently I have a 30 character name I have 8 character roll number I have integer hostel I have 5 sort of locations for floating point values for marks and I have a 2 character grade now all of this refers to a single student in the sense that every student of my institute will have these attributes if I describe these arrays and roll number and everything differently it will be very difficult for me to keep track of which student's name I am talking about and whether I am talking about his or her marks or somebody else's marks typically this problem is traditionally solved by declaring many arrays one dimensional or multiple column arrays which are of different types for example I can declare a character array of name 1000 by 31 I can declare a roll number array of care 1000 by 9 I can declare hostel 1000 as integer there are 1000 hostels but I will use these 1000 element arrays to store the records of each one student with one index value say 35th student then 35th element of that large array will be named again it will be a 2 dimensional array etc. instead a far better mechanism is to define a structure so what we are defining here is called a structure prototype struct student info type this is the name I have given to this structure this means that student info type has 1 2 3 4 5 components now I can treat student info type as if it was a data type of my own so this is how I am creating my own data type so just as I have int I have float I have double I now have student info type as another type and whenever I declare variables of a data type the memory locations get allocated to store values of that particular data type when I say int or float for example similarly I can use the declaration struct student info type this is actually a type definition just as I have int float I have struct student info type and now I am writing the variable name s or a array s list so s list is an array of structures and if there are 1000 elements I can actually store data for 1000 students here note that every element of this array s list is a complete structure so each element has components name role hostile marks and grade similarly s which is a variable which is of the structure type s itself has all these 5 components I can also declare a pointer to these structures by saying struct student info type star p notice that when we have integer we say int star p float star q here we cannot say student info type star p because student info type is not the complete description of that type the new type that we have defined is actually called struct student info type so we should remember and remind our students that the new type being defined is not student info type but struct student info type meaning it is a structure whose name happens to be student info and of that type a pointer is being defined here so struct student info type star p this program continues to illustrate some usages of the structure for example I can say s not name 0 equal to n so s is a structure variable since it has 5 components one of the components is name s not name is the way to refer to that component s not any component is the way to refer to any component since the component is an array I am arbitrarily showing how a single character n can be defined to be the can be assigned to the 0th element of name since name 0 is a character array s not name 0 becomes the character array belonging to the structure variable s and this can be treated as a character array anywhere in my program similarly hostel is an integer number s not hostel happens to be the hostel number that will get assigned to the element hostel of s I can say p equal to and s is exactly like any other pointer assignment where the address of s is calculated by and s and is assigned to p once I assign this address to p just as I can say s not name s not hostel I can also refer to these by using the pointer p however the way you refer to the elements of a structure using pointer is different that is illustrated in this print f statement where we say hostel number is percent d and then the reference is made like this p dash greater than sign hostel or p minus sign greater than sign hostel so this symbol is actually a membership symbol when the left hand side is a pointer note that I would have equivalently said s not hostel it would mean the same thing so if I am referring to a structure name then structure name dot component is the right way of referring it however if I assigned a pointer then pointer hyphen greater than is the right way of referring in short p and this symbol hostel means it is the hostel element of a structure which is pointed to by p I can get the size of structure by saying size of s I can get the size of marks by saying size of s dot marks I can get the size of grade by saying size of s dot grade and I can get size of p as size of p that is the pointer why I am writing all of this this is to show you how the sizes of individual components ultimately get added up to the size of the entire structure to recapitulate let us very briefly go to the previous slide here we have int main structure student info type this has 31 bytes in name remember that backslash 0 has to be included then it has 9 bytes in roll number this makes up 40 bytes then there is an integer hostel which will require 4 bytes float marks there are 5 element array each one requires 4 bytes so this amounts to 20 bytes and then there is a character array it is 3 elements it will occupy 3 bytes this we know to be the sizes of individual elements we just want to confirm what happens when the compiler allocates memory so that is why this segment of the program is written what is important here is to note that while referring to any member of a structure we use the dot so s dot member but while referring to that member using a structure pointer we use a hyphen followed by a greater than size please do not look for this symbol on keyboard there is no single symbol this is a composite symbol so we say p hyphen greater than member there is exactly the same meaning as s dot member let us just go to the questions one by one Chennai has a question if the name is long the alignment is not neat and correct how would I solve it ok the question is that if the name is long say 63 bytes or 74 bytes or whatever the alignment is not correct the point again I will make is why should we bother about the alignment let the compiler do the dirty work these questions by the way you will see being raised in the classical text books also belong to an era where the total memory of the computer used to be 64 kilobytes 512 kilobytes etc. these days even a lullu pc comes with a memory of 1 gigabyte 2 gigabytes and the kind of programs that we usually write on our computers do not stress the boundaries of the available memory and therefore while allocating the memory if the alignment requires that few memory bytes are wasted well let it be it is the compiler's job to allocate memory as long as it does it properly I should not worry technically the question that you raise is important and it should be explained to people that there could be a need for some slack bytes while allocating memory to a structure I will also tell you where this question becomes very relevant this question becomes very relevant to computer science students who later on how to write compilers and who therefore must understand the integrity my own take on this particular aspect is that the first course is being taught to all engineering and science students and even management students and it is not correct to burden them with technical details which are not going to be relevant for the kind of programs that they will write as far as computer science students are concerned either in this course not necessarily though but in subsequent courses which they do with the computer science department or IT department there is ample opportunity to explain to them how compiler should be designed how memory should be allocated etc. in short this and all related question I have only one answer yes technically it is correct to understand that such thing may happen but no I am not going to be bothered with it I don't care one who how compiler allocates memory as long as all my variables arrays structures and arrays of structures are taken care of this is exactly what I tell to people in the industry when I work with them on performance monitoring and benchmarking and when people say I have a 64 bit machine or I have a machine which has so many MIPS rating or my machine can carry out so many floating point operations to them as an advisor to people who use general purpose programs not computer scientists people like bankers people like financial institutions people like railway bridge designers people like car designers they all use programming languages such as C to write the applications for either numerical computation or their business data processing they will have demands on processing efficiency both the space efficiency and time efficiency but that is measured in terms of real time required to execute their programs versus the actual time that is available to them usually the time available is longer than the time it takes to execute the programs and therefore they do not care at all about the underlying technology in actual usage my answer to such sort of suggestions is that look Mr. So and so for this band I need to execute let us say 200,000 transactions per hour now whether your computer is 64 bit whether the memory is aligned properly whether there is no wastage of byte I don't care in fact I don't care if you yourself personally sit inside that box and correctly deliver 200,000 transactions per hour to me that is the disdain with which a modern application programmer and a domain expert must treat the computers the computer its memory its processor is meant for me I am not meant for computer its processor its memory you might say that I am saying exactly opposite of what I advocated some time ago that students must be taught to write efficient programs please note that when I say efficient programs should be written I mean that at our level of understanding and readability whatever we write should be as efficient as possible writing compilers is somebody else's job and therefore I should neither want to know too much about the integrities of what compiler does or how it should behave that is not our domain for the first course in programming is there any question why it is not possible to assign string constant to character array using this well it is not possible to assign because C language does not permit it if you ask me it is the stupid inadequacy of the C programming language if a string can be assigned to the initial declaration I do not see why C compiler cannot generate instructions to assign a string to a string array on the left hand side after all we do that by writing a loop for instruction or something and the compiler can very easily do that using exactly the same mechanism it just so happens that the C language by design does not have this feature and therefore this is not permitted of course an equivalent thing can be very easily done by using one or more of the very strong and powerful functions which are contained in the string.h library so please read more about string.h library and you will soon be forgiving C compiler for not giving adequate features because all that you need is available and perhaps more is available in the standard C library as a matter of fact those of you who are inclined to think in terms of compilers will notice that there are functions in string library which actually permit you to identify tokens and identify different fields for example in today afternoon exercise you will spend a lot of programming efforts to locate those commas and identify different fields which lie between the commas there are functions in C which will permit you to do all of that in one shot identifying different fields and allocating different fields to let us say different portions of them but I will leave it to further investigation and all the best can I go over to the query just why we are mostly using structures even when we have memory advantages in union then structures I disagree with this there are no memory advantages per say in unions over structure ultimately memory will have to be allocated by the compiler and once again I will stress that memory advantage in small is not relevant memory advantage in large is relevant so if I have a billion bytes being wasted I should worry about it but I have 100 bytes being wasted is not worth the effort of a programmer to look at just as in case of time efficiency it is important to reduce time by even fractures and therefore in my time equation k 1 times n square plus k 2 times n plus k 3 if I can reduce k 3 from let us say 2.8 to 1.2 yes that is an advantage but if n is large what I should worry about is to reduce k 1 times n square so I should try to reduce k 1 best I should try to eliminate the n square term completely in exactly the equivalent way memory efficiency should not be our primary concern unless the memory is being wasted very largely I will give you one example where memory efficiency should be a bother suppose you are handling very large arrays and by large I do not mean 100 by 100 I do not even mean 1000 by 1000 I mean 50,000 by 50,000 suppose you have a two dimensional array which has 50,000 rows and 50,000 columns invariably you will find such large arrays cannot be accommodated in the memory or you are handling 100 digit numbers in a multiplication arithmetic that is where you should worry about memory allocation I submit once again that structure unions while they might have relative advantages and disadvantages they are small as compared to larger issues and we should tell our students while telling them correctly what happens in these two cases we should tell them not to bother too much about these unless they happen to be part of a larger issue such as as I said 50,000 by 50,000 one question that I will raise for you since many of you are talking about memory efficiency imagine that I want to store a large array which is a sparse matrix those of you do not understand sparse matrix sparse matrices are those which have maximum number of elements as 0 and only few elements are once typically these ones happen around along the diagonals of these arrays so the main diagonal and maybe the neighboring smaller diagonals would have non-zero values but all other values are 0 such sparse matrices arise very frequently in large number of scientific and engineering computations now you will notice that if I take a normal matrix and allocate it 50,000 by 50,000 the total number of elements allocated are huge although the actual number of non-zero elements are very few that is where the creativity of the programmer and the concern for memory efficiency should show and that is where we need to use techniques which go beyond the conventional programming techniques I would refer to recipes numerical recipes in C which tells you how to handle such memory cases for example, Badnera has a question Good morning sir, I am from PRMITR Badnera, Suresh my question is regarding the pointers does the length of a pointer depends on the size of a processor or it is same for 32, 16 or 64 bytes processors Okay, good this question I have tried to answer earlier it is given as 4 only Yes, this 4 is I will repeat again this 4 is not a constant value for all computers this 4 came out because the computer on which I ran that program which was printing the size for that computer the C pointer happened to be 4 bytes if you run the same program on some other computers you may get a different value however as I mentioned this value the size of the pointer yes indeed is often connected with the computer's architecture so typically if you have a 32 bit machine a 32 bit architecture the pointer will be 4 bytes if you have a 64 bit architecture the pointer would be 8 bytes there are a few exceptions notably an old IBM machine called IBM AS 400 they actually when they created that machine it is an extremely interesting study to see how abstraction and power of abstraction was used so while the internal memory kept on evolving from 16 bit to 32 bit as far as architecture was concerned but the first layer the machine instruction layer automatically provided for 128 bit addressing and they did internal jugglery in electronics or in software to compile these 128 bit addresses to much smaller address place but to conclude your question is your suggestion or your observation is right generally the pointer site is connected with the machine architecture and the 4 that you saw here is not at all a universal truth it merely happens to be the size of the pointer on a particular computer on which I ran that program to determine sizes it is compiler dependent it is machine dependent and generally it is connected with the computer architecture there is another question see languages how much comfortable to handle images as an input okay I will repeat the question what can be the data type for that okay I will repeat the question the question is I think all of you have heard this how comfortable is the language in handling images and what should be the data type for that images okay so let me answer this question more generically to the best of my knowledge there is no programming language which naturally handles images all programming languages handle images typically as a two dimensional array of pixel values and therefore every programming language including see is either equally comfortable or equally uncomfortable handling digital images so that is the truthful answer it should not matter whether you are writing a program in C C++ Java Algal Cobol C I mean Fortran basic whatever which are programming language you choose to the best of my knowledge there is no programming language which has a direct underlying type for image image is always handled as a two dimensional array where every element contains a pixel value in fact for more complex images such as color images is pixel value itself has three components red blue and green and you might be required to store each one separately or you may artificially combine them by concatenating the eight eight eight bits and therefore a pixel value is represented as 24 bits which itself is not even a single number it 24 bits represent three different components each one representing a red value blue value or green value so such are the nuances and the I have to conclude the answer is no other language and therefore not even see language is either comfortable or uncomfortable with image and there is no native data type in which image can be represented for these programming languages as far as the abstraction to a programmer is concerned however if you use object oriented programming languages such as C++ or Java or C sharp or n number of other things then it is possible to define what we call abstract data types in which you can define abstract data type as an image and you can even perhaps define operators on those images but these are constructed as part of specialized applications and are not a part of the natural features of a programming language indoor as a question if at machine one intakes two bytes and at machine two intakes four bytes then what is the difference between int and short int at machine one impossible to say because this is a compiler feature and not a machine feature so the compiler may allocate the same number of bytes to short int and int just as for example in our case we have seen that int and long int have the same size so this is entirely a compiler feature and any attempt to say that because on one machine this is like this and on another machine this is like that and that is like this and that is like that on these two machines therefore something else should be like that is mere speculation there cannot be any logical reasoning and connectivity it must be examined because all of these in the standard are defined as implementation dependent feature and a specific implementation has to be tested explicitly to find out what are the limits however there are sizes and maximum value limits defined for every implementation in special header files I will try and locate the header file references for you you can examine for any compiler and the associated header files you can examine what these are and that is what will be guaranteed in terms of size independent of in fact the machine architecture or whatever so the implementation will be for specific machines which you can see Surat has a question when pointer variable contains only address of any variable then why we declare that pointer variable with data type the pointer variable does not contain address of any variable I repeat the pointer variable explicitly contains the address of a variable of a defined data type once again to go over if a short in takes two bytes and a float takes four bytes then incrementing a pointer of short in type will add two to the pointer value incrementing a pointer of float type will add four to the value exactly in order to determine how pointer arithmetic can be done the compiler must know the pointer is associated with which data type and that is the reason why no declaration of a pointer generically is permitted to refer to any element but a pointer must be defined in the context of the data type which it refers to and that is why we have star float star something in star something short in star something double star something I will request that if there are any other questions please send these through email and I will try to compile the answers thank you very much for bearing with me.