Dedicated to baba Who couldnt be here to see this day He is a much sought after speaker on various technology subjects and is a regular columnist for Express Computers and Developer 2. In recognition to his contribution Microsoft awarded him the prestigious Best. NET Technical Contributor award recently.
|Published (Last):||7 May 2018|
|PDF File Size:||7.91 Mb|
|ePub File Size:||19.37 Mb|
|Price:||Free* [*Free Regsitration Required]|
Dedicated to baba Who couldnt be here to see this day He is a much sought after speaker on various technology subjects and is a regular columnist for Express Computers and Developer 2.
In recognition to his contribution Microsoft awarded him the prestigious Best. NET Technical Contributor award recently. He can be reached at kanetkar kicit.
Preface to the Fifth Edition It is mid Countless Indians have relentlessly worked for close to two decades to successfully establish India as a software brand. At times I take secret pleasure in seeing that a book that I have been part of, has contributed in its own little way in shaping so many budding careers that have made the India brand acceptable.
Computing and the way people use C for doing it keeps changing as years go by. So overwhelming has been the response to all the previous editions of Let Us C that I have now decided that each year I would come up with a new edition of it so that I can keep the readers abreast with the way C is being used at that point in time.
There are two phases in every C programmers life. In the first phase he is a learner trying to understand the language elements and their nuances. At this stage he wants a simple learning environment that helps him to master the language. Hence the first fifteen chapters are written keeping this environment in mind, though a majority of these programs in these chapters would work with any C compiler.
Armed with the knowledge of language elements the C programmer enters the second phase. Here he wishes to use all that he has learnt to create programs that match the ability of programs that he see in todays world.
I am pointing towards programs in Windows and Linux world. Chapters 16 to 21 are devoted to this. I would like to your attention the fact that if you want to program Windows or Linux you need to have a very good grasp over the programming model used by each of these OS.
Windows messaging architecture and Linux signaling mechanism are the cases in point. Once you understand these thoroughly rest is just a matter of time. Chapters 16 to 21 have been written with this motive. In Linux programming the basic hurdle is in choosing the Linux distribution, compiler, editor, shell, libraries, etc. To get a headstart you can follow the choices that I found most reasonable and simple.
They have been mentioned in Chapter 20 and Appendix H. Once you are comfortable you can explore other choices. Though I used to like these chapters a lot I had to take a decision to drop them since most of them were DOS-centric and would not be so useful in modern-day programming. Modern counterparts of all of these have been covered in Chapters 16 to However, if you still need the chapters from previous edition they are available at www.
Also, all the programs present in the book are available in source code form at www. You are free to download them, improve them, change them, do whatever with them.
If you wish to get solutions for the Exercises in the book they are available in another book titled Let Us C Solutions. Let Us C is as much your book as it is mine. So if you feel that I could have done certain job better than what I have, or you have any suggestions about what you would like to see in the next edition, please drop a line to letuscsuggestions kicit.
All the best and happy programming! Contents 1. The Decision Control Structure Decisions! In this chapter we would briefly outline these issues. Four important aspects of any language are the way it stores data, the way it operates upon this data, how it accomplishes input and output and how it lets you control the sequence of execution of instructions in a program.
We would discuss the first three of these building blocks in this chapter. It was designed and written by a man named Dennis Ritchie. No one pushed C. It wasnt made the official Bell Labs language.
Thus, without any advertisement Cs reputation spread and its pool of users grew. Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than 3 decades has to be really good.
I seriously beg to differ with this opinion. This is because while learning these languages you have things like classes, objects, inheritance, polymorphism, templates, exception handling, references, etc. Learning these complicated concepts when you are not even comfortable with the basic language elements is like putting the cart before the horse.
Though this two step learning process may take more time, but at the end of it you will definitely find it worth the trouble.
This organizing principle has lots of advantages to offer. But even while using this organizing principle you would still need a good hold over the language elements of C and the basic programming skills.
This is because even today when it comes to performance speed of execution nothing beats C. Moreover, if one is to extend the operating system to work with new devices one needs to write device driver programs. These programs are exclusively written in C. Let Us C e Mobile devices like cellular phones and palmtops are becoming increasingly popular.
Also, common consumer devices like microwave oven, washing machines and digital cameras are getting smarter by the day. This smartness comes from a microprocessor, an operating system and a program embedded in this devices. These programs not only have to run fast but also have to work in limited amount of memory.
No wonder that such programs are written in C. With these constraints on time and space, C is the language of choice while building such operating systems and programs.
The essence of all such games is speed. To match the expectations of the player the game has to react fast to the user inputs. This is where C language scores over other languages. Many popular gaming frameworks have been built using C language. Since C provides several language elements that make this interaction feasible without compromising the performance it is the preferred choice of the programmer. I hope that these are very convincing reasons why one should adopt C as the first and the very important step in your quest for learning programming languages.
Getting Started with C Communicating with a computer involves speaking the language the computer understands, which immediately rules out English as the language of communication with computer. However, there is Chapter 1: Getting Started a close analogy between learning English language and learning C language.
The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier.
Instead of straight-away learning how to write programs, we must first know what alphabets, numbers and special symbols are used in C, then how using them constants, variables and keywords are constructed, and finally how are these combined to form an instruction. A group of instructions would be combined later on to form a program.
This is illustrated in the Figure 1. Figure 1. Let Us C A, B,.. Let us see what are constants and variables in C. A constant is an entity that doesnt change whereas a variable is an entity that may change. In any program we typically do lots of calculations.
The results of these calculations are stored in computers memory. Like human memory the computer memory also consists of millions of cells. The calculated values are stored in these memory cells. To make the retrieval and usage of these values easy these memory cells also called memory locations are given names. Since the value stored in each location may change the names given to these locations are called variable names.
Consider the following example. Here 3 is stored in a memory location and a name x is given to it. Then we are assigning a new value 5 to the same memory location x. This would overwrite the earlier value 3, since a memory location can hold only one value at a time. This is shown in Figure 1.
As against this, 3 or 5 do not change, hence are known as constants. Types of C Constants C constants can be divided into two major categories: a Primary Constants b Secondary Constants These constants are further categorized as shown in Figure 1. Let us see the details of each of these constants. For constructing these different types of constants certain rules have been laid down.
These rules are as under: Rules for Constructing Integer Constants An integer constant must have at least one digit. It must not have a decimal point. It can be either positive or negative. If no sign precedes an integer constant it is assumed to be positive.
For a bit compiler the range would be even greater. Question like what exactly do you mean by a 16bit or a bit compiler, what range of an Integer constant has to do with the type of compiler and such questions are discussed in detail in Chapter
Let Us C++ - 3rd Revised & Updated Edition
Parminder Kang rated it did not like it Sep 19, To see what your friends thought of this book, please sign up. Books — Category Description. Yashavant Kanetkar This book is not yet featured on Listopia. Amol rated it liked it Dec 06, C Programming is not exception to this rule as well.
LET US C PLUS PLUS BY YASHWANT KANETKAR PDF