- Emiley J
The C language shook the computer world. Its impact should not be underestimated, because it fundamentally changed the way programming was approached and thought about. The creation of C was a direct result of the need for a structured, efficient, highlevel language that could replace assembly code when creating systems programs. As you probably know, when a computer language is designed, trade-offs are often made, such as the following:
C is a general-purpose programming language. It has been closely associated with the UNIX operating system where it was developed, since both the system and most of the programs that run on it are written in C. The language, however, is not tied to any one operating system or machine; and although it has been called a ``system programming language'' because it is useful for writing compilers and operating systems, it has been used equally well to write major programs in many different domains.
The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages: Print the words, hello, world. This is a big hurdle; to leap over it you have to be able to create the program text somewhere, compile it successfully, load it, run it, and find out where your output went. With these mechanical details mastered, everything else is comparatively easy.
This C sample program uses the formula oC=(5/9)(oF-32) to print the following table of Fahrenheit temperatures and their centigrade or Celsius equivalents:
- Daniel Malcolm
The for statement is a loop, a generalization of the while. If you compare it to the earlier while, its operation should be clear. Within the parentheses, there are three parts, separated by semicolons. The first part, the initialization
In C, a function is equivalent to a subroutine or function in Fortran, or a procedure or function in Pascal. A function provides a convenient way to encapsulate some computation, which can then be used without worrying about its implementation. With properly designed functions, it is possible to ignore how a job is done; knowing what is done is sufficient. C makes the sue of functions easy, convinient and efficient; you will often see a short function defined and called only once, just because it clarifies some piece of code.
The keyword struct introduces a structure declaration, which is a list of declarations enclosed in braces. An optional name called a structure tag may follow the word struct (as with point here). The tag names this kind of structure, and can be used subsequently as a shorthand for the part of the declaration in braces.
In C, there is a strong relationship between pointers and arrays, strong enough that pointers and arrays should be discussed simultaneously. Any operation that can be achieved by array subscripting can also be done with pointers. The pointer version will in general be faster but, at least to the uninitiated, somewhat harder to understand.
Most Viewed Articles on C
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews
Subscribe to Tutorials
1. Please assist me in getting the code to read messa
View Tutorial By: Jaydatta at 2009-04-05 23:24:57
2. The code for CharArrayReader is not working. So, w
View Tutorial By: Maya Joshi at 2012-06-23 14:30:26
3. i need a J2me PIM for accessing phone contact... <
View Tutorial By: shafique at 2011-06-28 04:11:55
4. Hi.. Everyone... i would like to send and received
View Tutorial By: Michael at 2011-01-29 23:43:23
6. concept of static keyword is beautifully explained
View Tutorial By: jaideep aswal at 2012-04-14 07:21:56
7. I deploy a project in apache tomcat and backend to
View Tutorial By: satish at 2010-08-04 05:31:59
8. thanks brother i hope this is most important for e
View Tutorial By: manglesh upadhyay at 2012-09-26 04:40:41
9. Hi, thank you so much for this. I am going to give
View Tutorial By: Eddie at 2011-02-21 14:10:04