 There is a question from Vellore, so let me go over to Vellore, I can see you people here, there seems to be a query from your side over to you Vellore. Thank you Asha, an interesting technical question. First of all the notion of function overloading, notion of overloading itself is not associated with procedural programming languages. This notion is associated with object oriented programming languages. A lot will depend upon how you are compiling your program. If you are using GCC, GCC might assume that you are actually compiling a C++ program and there are lot of overloading which might implicitly happen. The specific case that you mentioned does not appear to me to be the case of function overloading because function overloading or operator overloading has some specific meaning. To give you a technically correct answer, C programming language and the functions written in C programming language do not have any notion of function overloading. The semantic meaning and implication of a particular way of writing things in scanf and printf function may be so, may be appearing to have function overloading merely because the definition of the semantics of function and as it is called as you are saying must be exactly as that has been prescribed in the standard definition and meaning of the function. So, I hope that answers your question. There is no notion of overloading in C, C functions or C operators are not overloaded. NIT suratkal seems to have a question I can see my friends from NIT suratkal over to you suratkal. NIT is asking a question whether by any method it is possible to call my main function from somewhere else. The answer to this question is no by the way. You can always contrive that you have compiled your main program and you have created a standalone executable. The executable file has a certain name. Let us call it prog1.o. Now it is possible for me to write a shell script in Unix which will invoke this program. It is also possible for my shell script to pass certain parameters to your program through arcC and arcV if you have written your main program to analyze this. So technically even main program can be called. However, in the context of your question, can the main program be invoked as a function in the same sense as other functions are invoked, the answer is no. Raja Ram Bapu Institute, there is some question from one of the participants. I can see you over to you for your question. Thank you so much. The question asked I will repeat. The question says is it possible to write to make nested function calls and is it necessary to write a return statement? If I do not write return, what happens? Nested function calls are no different from ordinary function calls. In fact, we are going to discuss recursion tomorrow and you will find that implicitly a recursive call is nothing but a nested call. Incidentally, I do not agree with you that a function need not have return statement. The very objective of a function is to return a value and the return statement should be there. However, when you have nested calls, the return value do not come to the top invocation but they go to the intermediate invocation. I will describe this in greater details when we discuss recursion tomorrow. But good question, thank you. There are lots of questions on AVU now. I will go over to NIT Calicut first, followed by NIT Durgapur, then GEC Trishur, Varangal, Bhopal, Kukas and Jalandhar in that order. I am trying to connect to NIT Durgapur now. I can see NIT Durgapur. Over to you Durgapur, please raise your question. Thank you sir for giving me the opportunity to ask the question. I want to know if there is any way we can calculate the memory required for a function in C program. And what is the maximum memory if function can allocate in the program execution? How to calculate the size of function in a program? And what would be the maximum size of a function? Just like we calculate the size of data type like size of operator, if there is any way we can calculate the total memory. The question is how do I know how much memory is required by a function? I believe you are talking about two things here. One is the size of the compiled program in that what will be the amount of memory that will get allocated to that function. There is no difference between the memory that gets allocated to a program and the memory which gets allocated to a function within a program. Anytime you compile a group of any code together, the compiler will allocate memory to whatever components which require memory. These will include the translated machine instructions, but more importantly these will include also the data structures that you have declared within the function. If function is not using any large amount of data such as large arrays or something for its own internal computations, then typically the memory required or taken up by a function is very limited, limited by the size of the translated code and of course a few parameters and issues such as stack that we mentioned. When we call a function from another function, there are some intermediate additional memory requirements which are needed to support this invocation business. There is a question which someone had asked about the stack size. The stacks which get dynamically created and on which things are loaded will all depend upon the number of parameters that are being passed and if the calls are recursive what is the level of nested recursion that is there. Other than that there is no particular way of finding out how much memory a function occupies. The only decent way is please compile a function in a standalone basis and look at the size of the executable that you get. Many times even that is not a good indicator because many times you do not create a standalone executable but you use what is the equivalent of dynamically linked libraries. So only when you start running a program additional memory may have to be allocated. In general then as a thumb rule what we should say is that if I have a function, the total memory required for that function will be the sum total of A, the size of the translated code which are the machine instructions, B if there are any call and calling sequences the amount of memory that is required for the stack and C any data structures which have been declared inside the function so that whenever the function is invoked that data whether it is dynamic or static it does not matter that much memory will have to be allocated. So if you have let us say an array declared inside a function which is let us say an int array with 10,000 elements then 40,000 bytes will be allocated whether you use them or not it does not matter. So to conclude there is no difference between the memory occupied by a function and memory occupied by any other program segment and the best way to find out the exact memory if at all you wish to know is by compiling it in a standalone fashion and looking at the size of the executable that you get. NIT Jalandhar has a question multiple mapping between integers and their binary representation when computed return the same value. I am sorry I did not get this is a question from Nirmah Amdabad multiple mapping between integers and their binary representation. I do not understand it perhaps what you mean is different ways of representing integers in the binary representation. The only two representations I can think of is signed and unsigned and I had tried to explain some difference logically here but if you refer to any standard text it will tell you what are the differences. There is an interesting question from Jalandhar which refers to the Paragaji issues which I was describing how to convince students from other branches than CSE to keep interest in computer programming while teaching this subject. Wow this is this is this appears to me to be the exact opposite of the problem that I see in some places. Usually in IIT the students who are most interested in learning programming are not necessarily students from computer science program but students from other branches. While of course the computer science students score good grades along with the students from electrical engineering chemical engineering etc but if you ask me who were the S programmers of my batch of 800 people if I were to list let us say top 20 students then at least the 12 of them will be non computer science students. So you seem to have an interesting problem Jalandhar I will apply my mind I will have to understand why you think they show less interest in computer programming. The reason why our students seem to be interested in computer programming is because many of them actually want to do IIT jobs later. Perhaps through an email you can let me know why you think they are not interested in programming. There is one question from Periyar University yes let me let me go to Maniyama Periyar over to you. Built-in function. Interesting question she is asking whether it is possible to convert our function into a built-in function. So let us very quickly understand what is a built-in function and what is our function. Firstly there is nothing like built-in function. We call a function a built-in function because it comes automatically through a standard library. We think it is built-in because implicitly it gets included in my compiled program particularly when I have included the standard library. So in C program whenever I say include stdio.h a whole lot of functions get included in the compiled form but if we realize that these functions have been written by someone they are called standard because they are implicitly made available to all C program. Please remember that if I do not say include stdio.h then those functions will not be included. In exactly the same fashion if I want to convert my function or a set of functions into built-in functions all that I need to do is compile one or more functions automatically put them into a separate library call that library by some name like mystdio.h and ask everybody to include mystdio.h automatically all the functions which I have written could become equivalent to built-in functions. So there is final answer there is nothing like built-in the built-in actually means that I am using some library functions and just as there are standard C libraries I could easily write my own libraries and include them for automatic to give a semblance of a built-in function there. This is Mrs. Lokre Jadav asking a question from Rajaram Bapu Institute unfortunately the audio is very low so the question was that while C is a procedural language procedural programming language is it possible to create objects in C? The answer is slightly contrived but let me try to explain the notion of objects is associated not only with the notion of classes, methods and the objects as we understand them but it is also associated with object-oriented programming creating objects can be done in any programming language particularly if we consider C programming language and if we understand that C programming language has been used not only to build operating system but also compilers as a matter of fact the C++ compiler itself has been written in C and therefore ability to create objects in C is not at all doubted yes of course you can create objects in C however having created those objects in C will you be able to handle those objects giving object-oriented instructions is a different question altogether it is completely possible for you to write functions in C which implement classes functions in C which invoke which instantiates object which invokes objects which make objects interact with each other in a proper object-oriented way but the way you will do all this will be very artificial so the answer is yes you can create objects yes you can make objects interact with each other in an object-oriented fashion but will you be doing so by giving instructions in an object-oriented manner the answer is no the instructions that you will be giving will still be C program instructions and those instructions will still look like pro-steal programming instructions the correct question to ask is if I want to handle objects would C be the best thing to do? the answer is no if I really want to handle objects better use a programming language with object-oriented paradigm and if you are familiar and comfortable with C C++ is an ideal language otherwise the more popular programming language is Java in which you work with classes in objects RaiSoni has a question and the question he is asking is that can we write user-defined functions which will work similar to scanf and printf yes of course you can in fact when we will discuss the files in C we will notice that just like you have scanf and printf we can have fprintf which will work with files and in those functions which do a file read and file write it should be possible for me to write some additional functions of my own which will simulate the behavior of scanf and printf and which will work indirectly through a file input output statements which are available in C if we notice that normal scanf and printf work on the files which we traditionally call STD in and STD out there is absolutely no reason why we cannot write the same programs but I would like to warn you on two things one scanf and printf are generic functions the number of parameters in that function are also variable it is not easy to write that kind of functions ordinarily second if scanf and printf already exist why would I ever like to write functions which do exactly the same thing I would rather write functions which will do something else which the scanf and printf does not do so the answer to your question is yes we can do it but an additional answer is no please do not try to do it let us go over to in the chat there are some questions Trissure it seems that the syntax of scanf is found complicated due to the parameter symbol percent and to newcomers why is it so complicated very good question Trissure somebody from Trissure is asking a question that the syntax of scanf is found complicated because the presence of symbols like percent and so why it is so complicated good question but this question you and me should ask the people who define scanf about what 35 years ago unfortunately the syntax of these so called standard built-in functions or effectively functions which are part of the standard library IO library of C were written 35 years ago let me explain the mentality of the people great people by the way at AT&T history was being created there the objective of those people was to create a programming language which could be used to do systems programming and they were they created C programming language not with an intention to write scientific computational programs or not with an intention to write data management program the intention was slightly different there was a small group it was never thought that this programming language will be used by millions of people across the world and therefore they decided to choose wording symbolism syntax etc which they were okay with so if you look at it from an expert point of view who understands pointers who understands strings who understands interpretation of incoming strings who understand the notion of tokens who understand separation of integer numeric values etc from wide space delimited fields etc for them this is child's play unfortunately what they did for a different purpose we lesser mortars today are required to teach a first year student from metallurgy or something you will notice that is the reason I have consistently avoided using scanf and printf even the assignment that has been shipped to you yesterday you will notice that my colleague Nagesh Kalmalai has actually written hash defines so you don't use scanf and printf but you use simple sounding input output statements I assure you that I hate the syntax of scanf and printf as much as you do and the first year students hate it more my answer to it is never use that you see in and see out remember I talked about the first month for the first month you see in and see out there is absolutely no problem later on when you discuss characters character type or character strings once students understand that it is only then according to me scanf and printf can be easily understood PhD Coimbatore has a question how to protect a function is in see their provision for excess restriction I am not so sure which format specifier we use for long double data type in C there is a C standard I will pull out the sheet so that I think when I discuss the scanf and printf the format specifiers of all kinds are described there so you will get that sheet as a part of the handout Nirmah Amdabad confirms that they have uploaded the things Nirmah Amdabad also has a pedagogy question why we do not introduce thinking skills and critical thinking in engineering by the way it is my impression that the entire purpose of the whole engineering education is precisely to introduce thinking skills and critical thinking if we do not seem to be able to do that perfectly then the problem is perhaps with us but let me assure you that independent of the ways in which we teach including constrained syllabus etc etc the very fact that the kind of work that engineering college students do including the labs and so on intrinsically by the way they are encouraged to think for problem solving and they are encouraged to do critical thinking but yes sadly we do not include these topics as formal things to be covered in engineering but implicitly this is always done in any engineering education is my opinion NIT Varangal has a question is there any universal notation for algorithms no sadly there is no universal notation NIT Jalandhar has a question is there any mechanism for error handling in C language yes error handling of course you will have to write program for it the intrinsic error handling is done by the C compiler incidentally there are two types of error one is the compiler error itself and in this respect the GCC is not a very good compiler in the sense that ordinarily you will get all the information but sometimes for some very trivial errors GCC will throw out hundreds of objections and that is something that we have to learn to live with this is about errors in the program itself the compiler error for runtime error I am not aware of any mechanism any special mechanism of error handling except that the reporting is done through the operating system so if you want errors to be handled you will have to write programs yourself or you will have to code the error handling yourself in your C programs there is nothing else that can be done from MANIT Bhopal how many number of parameters can we pass in a function I do not know of any restriction in the standard so I guess it is unlimited depending upon your capacity to write long lines MANIT Durgapur whether the everyday assignments would be uploaded by each of the participants or by the team leader yes it is a good question when you are talking about programming assignments I am talking generally about all the six labs individual programming assignments should be uploaded by individual participating teacher but the specific assignment that you are talking about which I have given yesterday formation of team and team members only the team leader should upload that assignment so I repeat the information about the team and the collective thinking of the team on what alternative programming projects they could think of please remove the line we said which your team will be doing it is not obligatory for your team to do that at this stage I just want your ideas on what could constitute good programming project so this thinking should be consolidated in a single upload and that upload should be done by the team leader NIT Varangal has a question how to make other functions as entry point for a C program apart from MAN I do not think I understand this question correctly if you are talking about the fact that the MAN program is the one which executes and all other functions are subsidiary then I do not see any which way you can make other functions similar to the MAN program these functions will always remain subsidiary and they will have to be invoked by someone they cannot become MAN programs themselves okay fine we will close the session today I am aware that many of you have still more questions as I said please do send email to workshop support that will ensure that I and my team gets a chance to consolidate these questions and we remain committed to discuss and answer all these questions because that is the fundamental purpose of all thousand people coming together thank you so much