 There are several questions from GEC Trishur, NIT Durgapur, Jaipur Indian College Cookers and Nirma Amdabad. So, before proceeding further, let me quickly go through each one of these very briefly. I am first trying to connect to NIT Durgapur. NIT Durgapur, I can see you all. I understand you have a query. Please raise the question over to you, NIT Durgapur. Sir, why we do not use ampersand while we are checking a string variable over to you? I am sorry, I did not get the question exactly why we do not use ampersand while checking the string variable. First of all, string variable is a notion from C++. There is nothing like a string variable in C. We have only character variables and we have character arrays to store the string. Whenever we have character arrays, any individual element of the array would require an address specifier, but the array name itself acts as a pointer whenever we pass it to the function. Let me go over to another center now. NIRMA-AMDABAD has a query. I am trying to connect to NIRMA-AMDABAD. I can see you NIRMA-AMDABAD. I understand there is a query from your side. Please ask the query over to you. Hello. Good morning, sir. We have two questions, sir. The first question is, I appreciate the power of attention in the privatization. I have one doubt in that. For example, we are processing one file which contains legs of records and we are trying to read the record through AWK and you said the variable which we are using in the AWK is not to be initialized. For example, legs of records have to be processed and in between something happens wrong. So we will have to start all over again from the beginning. Is it so? Is there any mechanism to retrieve the pre-processed record through AWK? So we don't have to pre-process from the beginning all over again. Thank you, sir. Over to you. Thank you for your question. The problem that you mentioned could happen with any program. Consider that instead of AWK, I have written a C program and it has to process legs of record and let us say it has processed some two leg records and something drastically goes wrong because of either our error in the program or an error in data which we have not accounted for while writing the program, in which case the program may crash and there will be no choice but to start all over again. In the conventional data processing, we have the notion of check pointing. That is, we usually complete some portion of processing, put that much data in file, close that file and then start all over again and we record that as a check point so that we don't have to reprocess the previous records. You could do exactly the same thing with AWK if you have lakhs of records to process. Process some portion, let us say 50,000, accumulate the values and take the output onto a file, keep on doing this in batches. In general, the problem that you mentioned has nothing to do with AWK. The question of initializing variable is a trivial issue. It is just that in C program, you have to explicitly initialize your variables. In AWK, the programming environment of AWK itself initializes the variables. So it is not that we don't have to, somebody has to initialize variables which AWK takes care of. In general, the AWK processing is of a different kind and the conventional programming processing is different kind. However, when you mention lakhs of records, rest assured that AWK, given the modern hardware, is perfectly capable of handling lakhs of records in a GFI. So that is not a problem. JEC cookers has a question. There are two mechanisms to read the values. One is through C in and second is through scanf. And we know the ranges of the different data types. In case if somebody enters very large value, then the compiler of the operating system takes care of the proper storage depending on the number of bytes reserved in advance. So how the user will come to know that the value read by the compiler or the operating system is the one which has the user has entered. So is there any validation mechanism or programmer himself has to take care of validation within the code? Thank you, sir. Over to you. Thank you very much. The question is that if a user gives a very large value, the assumption here is that the operating system or the compiler will handle it. But what we want to know is that what value has been stored inside? The correct answer is as follows. Since the values are being given by a user in response to a read request from the program, and since we have written the program, we have absolutely no reason to depend upon operating system or any other mechanism to take correct decisions for reading the values. We must provide for handling all inputs. In fact, if a user gives a value which is larger than what can be accommodated inside the variable location for which provision has been made two bytes or four bytes, then the result will be unpredictable. It is not that the operating system will correct it. It is, in fact, the C scan a function which will appropriately try to read either given overflow or truncate the number and store it. In general, neither the operating system nor the C programming environment automatically does any corrective action. And therefore, we have to take the corrective action. The question is very pertinent because in real life data processing problem inputs of all kinds can come. Indeed, that is the reason why for professional programs, generally you will not use scan f and print f without due care. It is not uncommon for people to read complete character strings from the input text and then interpret different characters internally by writing fairly complex validation programs. In short, validation of input data is the responsibility of the programmer who wrote the program and that responsibility cannot be handed over to operating system or the programming language. There is a question from Vijay T. I. Matunga, how to store database in Turboship. Now I will go to the chat. There are questions from G. C. Kukkas is saying, we are having multiple blanks in a given string. Then how can I use memchr function to locate my desired blanks? That is a programming question. As a matter of fact, that is part of an assignment that you will have to do because today in the lab you will have to analyze the kind of data that you saw or handling and you have to handle it through a C program. I have also included a sample C program which one of my students had written and you can read that program but you will have to go beyond that. The handling of extra blanks, either leading blanks, trailing blanks, etcetera, etcetera when you read a string is your responsibility. Yes, it is a challenge and to solve that challenge is the crux of a programmer's knowledge. So rest assured you will get it. The answer is unfortunately there is no straight forward way and no direct way or no simple way. You will have to examine individual characters, examine blanks and then solve the problem. G. C. Thishur has a question, why is the simple string handling features available in AUK is not incorporated in the C language? The answer is that AUK was written explicitly to handle fields and strings and numerical values. The objective is completely different. C programming language was defined much earlier than AUK. Moreover, there is no string handling capability directly in C. Please understand and appreciate that just as there is no input output capability directly there is no instruction. Similarly in C, the only instructions available to handle characters are individual character variables. You can compare the character variables. You can assign them character values and an additional facility available is the notion of a string in an array. That facility is that you can actually store a string by storing a series of characters of the string in array elements and putting a backslash null or backslash 0 or a null character at the end. These are called null-subminated string. Frankly, even in C, there are no direct facilities. All facilities are obtained from the standard library which handles character string and it is the strength of the functionality of the library which actually gives you those capabilities. What I would like to tell you is that whatever features that you see in AUK exactly that kind of processing can be done using the standard library functions. The only difference is you will have to build that functionality by appropriate usage of those functions and therefore you will have to write a long program. But it is possible for example that you identify a functionality in AUK. Say for example, ability to trim out the blanks and just get the string or ability to do associative array building. You can actually build all of these in C but you will have to write programs. You can write functions which invoke these capabilities and use your own function library to simplify writing of the main program. In general, I would suggest that it is wrong to compare AUK with C or AUK with any other crucial programming language or even object-oriented programming language. The purpose of AUK is different. In some sense, AUK is not a third-generation language. It can be equated to a fourth-generation language which we call prescriptive language like SQL. Those of you who have studied databases will know that in SQL you can give a command to do huge amount of extraction of relevant data from files in the database by giving a simple four-line, five-line SQL statement. Now, the question can be asked that why SQL can do it and then why I can't do it in C and C++? Well, the objective of defining SQL was only that and it got defined much later. As a matter of fact, in real life, people understand that there are some things which can be done most easily by scripting languages such as AUK or by database languages such as SQL. Whereas, there are certain things which can be done only with a C program. Consequently, it is not uncommon to find various components being built in different languages and used together. For example, as far as database is concerned, you can actually write SQL statements to handle data retrieval, etc. from the database but then retrieve that data in some array or variables in C program and then handle rest of the processing in C. So, I will repeat my answer. In general, it is not a good idea to say why this facility is there in this language and it is not there in that language. Every language is defined to provide certain features and to make things simplified in a certain sense. Other than that, however, each language has its own purpose and objective. So, with that answer, we will continue our discussion. Let me go over to PSG Coimtour. I can see PSG Coimtour here. If you have a query, please raise it over to you. Hello, sir. Good morning. We are happy to learn your interesting and endotic sections, sir. We have a question. Suppose I want to get the string and character input from the user rather than I mention percentages and percentage C continuously. If there is a problem, while we are giving the input to the system, first I give the string input to the system, then I give the space. The space is assigned to the character input, sir. So, what we have to do this? Thank you, sir. Thank you. The query was that if I am trying to read a character string and along with it a simple character variable, then when I read a string using a specification, the string gets into the array pointed out by my pointer. But unfortunately, the next blank is getting into the character variable, whereas I have perhaps another character given later. The point is that formatted input is best suited for situations when I want to get in different numerical values. If I am handling character strings and characters, my suggestion is very simple. Do not try to read this using formatted input. Instead, read the entire string by something like a gate line equivalent of function call. And once you get it inside in a string, then actually you can apply a scanf to that string or substring of that part by using a scanf. So, read the entire string from input as is given by the user and then parse it internally and analyze different components of the strings internally using your scanf function or directly examining bytes of the string. That is the only decent way in which you can actually handle the input of strings and characters very easily. I will try to go over to JEC Cookus now. I can see Jaipur Indian College Cookus people and if you have a query, please raise it now over to you. Sir, you got my question from Kate Mindo and you have already replied me. Thank you. Thank you very much. So, with this, we will get back to our session or there is a query from another center. So, let me go over to that center. I can see my friends from VNIT in Nagpur. First of all, let me take this opportunity to really compliment Professor Ravin Keskar and all others. I would, by the way, be interested in seeing this Mr. Rahul. If he is present, can he raise his hand please? Over to you. Rahul has raised his hand, sir. Maybe he will come in and he will just... Come, come, Rahul. What do you say? This is Rahul in between. Thank you, Professor Keskar. For the benefit of all participants from all other remote centers, I mentioned at the beginning that there was an interesting response to the question of load balancing and Rahul, in fact, has suggested a far more efficient algorithm which I described which actually works in order n if both arrays are sorted. Rahul, I would like to thank you for your effort. Please continue with the same zest. Now, if there is any other question, I would like that to be raised. Over to you, Nagpur. There is one question from here. I will just give the mic to the participant. Sir, my name is Ashwin Dameshram. I am doing MPEC from VNIT. So, I have two queries. The first one is that while compiling the yesterday's program splitting the name into task name and first name, the compiler was giving a warning that it is dangerous to use GATAS. And another question is that while iteratively using it, it was not stopping for input-output at GATAS. So, I used two GATAS for doing that. Over to you, sir. Thank you very much, Meshram, for this question. Yes, indeed, whenever you try to GATAS, GATAS is actually considered a deprecated function and is not recommended for usage. I will compile, perhaps, I will collect, perhaps, a better way of handling that. But I assure you, GATAS will work in almost all circumstances. I did not understand why you are getting a problem if you have multiple GATASs. Perhaps you, because the specification still says that a string will be read up to the backslash n, that is the new line character, replaced by a null character in the string that you collect data in. So, anyway, I will check it. Thanks for this observation. But indeed, it is true that all compilers say don't use GATAS, it is not good. I will try to find a better alternative and get back to you. There is one more query. There is a query from Jalgao. Let us go over to Jalgao. I can see you friends there. Please ask your query over to you. Good afternoon, sir. This is Adil Desani from the KSA Engineering College, Jalgao. So, my question is, are there any commands available with the Linux that print the output directly onto the printer? Over to you, sir. Okay. The simple answer is yes. There are commands available which will go directly to the printer, provided the printer is connected and configured properly. LPR or the line printer as the old term called permits you to print. However, it is possible for your program to actually give your output onto printf or any such statement and redirect the output file to a device file called printer file. There are multiple ways of doing it. But I assure you it can be done. So, I will leave the details for you to work out. Please raise this question with your other colleague participants and the center coordinator. I will be curious to know what solution you find and if you don't find also, please send an email to workshop support. I would like all other centers to think about this and try to answer this question. However, this primarily relates to the capability of the underlying operating system rather than programming. It's a real problem, so we'll try to answer it. But at the present, this is my answer. Vijay T. Matoonga has raised an issue. One last center from the remote centers is remaining and then I will go over to Vijay T. Matoonga and then we'll get back. Rajarambapu College, I can see you. Please raise your query over to you. Hello, sir. We have two questions. First question is what is the difference between null pointer and void pointer. And second question is which is the best book for C programming? What do you say? I will describe void pointer at a later stage. As I said, null pointer is something which does not point to anything. Void pointer, however, is not like that. Void pointer has a specific meaning. I will explain this tomorrow under the miscellaneous topics, so don't worry on that. As far as the second question is concerned, it's an extremely difficult question. What is the best book for C programming? Let me assure you that there is no universally accepted answer. Why? Because we teachers ourselves have different opinions. You ask this question to, say, ten different teachers and you will get at least six different answers because each one of us, depending upon our own style of teaching and depending upon the syllabus that we are trying to teach, depending upon the background of the students, may find a different book more suitable. For me, I still like the old Kannigan and Ritchie. I still consider it one of the best books, but it is slightly old. There is a book on ANSI C by Rakesh Agarwal. It's an ex-IBM which I find very good. But I also find the other common books like Balguru Swami or Karnatkar, etc., etc., to be good enough. My contention is that it is not the book which matters. The purpose and objective of the book is that our students are able to look at a large number of examples and large number of problems. But the way they develop their understanding will depend upon how we explain it in the class. Please remember that if book was adequate and access to book translated into programming knowledge, then our librarians who hold many books on C programming would have perhaps become the best C programmers. So, access to books alone is not adequate. And therefore, instead of searching for the best book, my suggestion is we should inculcate the habit amongst our students to read many books, not just one book. The sad tragedy is that these days students just want one book and want typically to be spoon-fed. Unfortunately, I believe we teachers are also responsible because we do not encourage them to read multiple books. And the real reason why we do not encourage them to read from multiple books is we ourselves do not read from multiple books. So, my request will be that instead of looking for the best book, and as I said one will find the best book for a particular objective depending upon the local requirements. But the idea should be to read multiple books. There is something very good in every book. Either some example, some illustration, some description. And I think as teachers we should actually be picking out the best exploration from different places and giving that benefit of the composite knowledge to our students. So, that is my answer. There is another centre still which is... Welllore. I can see Welllore here. There is a query from Welllore. Over to you, Welllore. Good morning sir. Till now I was searching for Welllore Institute of Technology. I had a query about... As a programme, we need to think about execution time or the programme complexity. So, in some programmes you are thinking about execution time. In some of the programmes you are considering about programme complexity. So, in which programmes we need to consider the execution time where it is applicable. Over to you, sir. I will sort of rephrase my answer given earlier. About execution time, we should always be worried about the execution time of every programme. Because our objective is to minimize that execution time. So, the answer is execution time and algorithmic complexity are two different things. And they are not things to be worried independently about. I only mentioned that we should not confuse between these two nations, notions. They describe different characteristics of a programme. Execution time describes how long physically it takes for that programme to execute as seen in my watch or as seen by time comma. Algorithmic complexity on the other hand describes the characteristic of the underlying algorithm of the programme as to in limiting case when the size of the problem becomes infinity or tends to infinity what is the kind of theoretical complexity. So, I will repeat again these two are independent things. One describes the nature of the algorithm that is algorithmic complexity. The other describes the real world physical time which it takes to execute a programme. So, my answer is for every programme I must worry about the efficiency of the programme namely the execution time. Because that is my brilliant but when I run the programme to handle say lakhs of records it should execute not in hours but preferably in minutes. That is the objective. However, at a theoretical level I must understand the complexity of underlying algorithm. So, I will repeat again these two are independent things. It is not that we should worry either this or that. In general, whenever we write a programme we should write our code such that operations are minimized and so that the execution time is less. However, for a deeper understanding of the underlying algorithm we should also analyze the algorithm and understand what is the complexity. So, these two are independent issues and they should both be treated with equal respect but in different contexts. The purpose is different. I hope that answers the question. The last centre is Vijay Tia and Matunga here. Vijay Tia and Matunga seem to have a problem in the camera but they have asked a question how to store database in a turbo-sea except file handling. I think this question is ill-formed. First of all, you do not store database in turbo-sea. You actually use turbo-sea commands to read data and write data just as in any other sea. So, there is nothing special about turbo-sea per se. Your data handling is decided by the instructions that you write in your programme and these instructions typically have to read data, process it and store it. So, I assure you that all the instructions that we see in sea programming are available in turbo-sea as well. There is nothing directly available or not available in either turbo-sea or GCC or any other sea compiler for the databases specifically. NIT Varangal has asked this question. I have already answered it. We are already losing time because I am going to waste five minutes of your time in describing an interesting episode that happened in my class. I believe it was very instructive although it is not technical, it is important. And then additionally, I want to very quickly describe the various functions available in sea standard library for handling files. So, I will close this interaction for the time being. Rest assured that all your queries would be answered but please make sure that you send those queries by email to workshop support. We have already accumulated previous queries and the answers are being compiled. We will complete that process for the additional questions that we get.