Computer Science

C Programming Language

The C programming language is a widely used and influential language in computer science. It was developed for system programming and has a simple and efficient structure. Known for its portability and flexibility, C has been used to create a wide range of software applications, operating systems, and embedded systems.

Written by Perlego with AI-assistance

5 Key excerpts on "C Programming Language"

Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.
  • Using LEDs, LCDs and GLCDs in Microcontroller Projects
    • Dogan Ibrahim(Author)
    • 2012(Publication Date)
    • Wiley
      (Publisher)

    ...Chapter 3 C Programming Language Microcontrollers can be programmed using one of several high-level languages. Some of the commonly used high-level languages are BASIC, PASCAL and C. Because of its ease of use and its power, C is probably the most commonly used high-level language for microcontroller programming. C has been used for the past 10 to 15 years and has gone through tremendous growth. Today, there seems to be an endless supply of low-cost, high-quality C compilers directed to any type of computer, from the PC to the smallest 8-pin microcontroller chip. Before the development of the C language, microprocessors and microcontrollers were being programmed using the native Assembly language of the target chip. Assembly language was a difficult language to learn. Also, it was difficult and time consuming to develop and maintain complex applications using the Assembly language. For example, developing a mathematical application using floating point arithmetic took days, if not weeks. The developed code was so large that it was difficult to modify or maintain it. In addition, the code was specific for the target processor. If it was required to upgrade to a different processor then, in most cases, it was necessary to re-write the complete code, consuming a lot of time and effort. C, on the other hand, is a portable language. In general, a C program written for a specific processor can easily be modified and used for another processor. Highly complex programs can be developed and maintained using the C language. The main objective of this chapter is to introduce new readers to the C language, through a simple overview of its fundamental features, in an attempt to start them programming early. The C language is described in a tutorial way, with many examples, in such a way that the readers can gain confidence and start coding immediately...

  • Designing and Developing Robust Instructional Apps
    • Kenneth J. Luterbach(Author)
    • 2018(Publication Date)
    • Routledge
      (Publisher)

    ...Chapter 3 Computer Programming Computer programming languages are tools for problem solving and creative expression. Indeed, people engaged in creative problem solving with computer programming languages developed technologies that resulted in the epochal transformation of the past half century. This information era is marked by computer programs (software) that implement the communication protocols enabling the Internet and the web; software enabling mobile communications; software enabling email and other messaging; software for shopping; software for creating 2D images and 3D models; animation software; office productivity software; voice recognition software, and software for learning, for instance. Learning a computer programming language is extremely beneficial as an outlet for creative expression and problem solving. One selects a particular programming language to fit a variety of circumstances. When it is necessary to receive and respond to data at particular microsecond intervals, one writes code in a low-level programming language using the CPU’s instruction set, which addresses memory and input ports directly. Commonly, though, application software is written in a high-level computer programming language, which eliminates the need to consider the computer’s architecture. After distinguishing between low-level and high-level computer programming languages, it is helpful to recognize four main programming paradigms: imperative (procedural/ structural); object-oriented; functional; and logical. Each paradigm has something to offer problem solvers (Kedar, 2011). In this book, we will not be using Haskell (Thompson, 2011) or any functional programming language (so no f(g(x)) for us in this work). Also, we do not consider a logiC Programming Language, such as Prolog. We will consider object-oriented concepts, as necessary. Object-oriented languages, such as C++, C# (C sharp), Objective-C, and Java include imperative language components...

  • The SAGE Encyclopedia of Educational Research, Measurement, and Evaluation

    ...Allison Jennifer Ames Allison Jennifer Ames Ames, Allison Jennifer Jonathan D. Rollins Jonathan D. Rollins Rollins, Jonathan D. III C Programming Languages C Programming Languages 231 234 C Programming Languages The family of C Programming Languages, consisting of C, C++, C#, and Objective-C, is a set of similar languages from different paradigms. The first of these languages, C, serves as the foundation for the set because its syntax, structure, and logic strongly influenced the development of the latter languages. Perhaps the most notable difference is that C# and Objective-C are object-oriented languages using classes that gain additional programming properties to build on the C language. The C++ language is inherently capable of object-oriented programming, but its flexibility also allows it to be programmed in the same paradigm as C. Due to the large number of similarities between them, a deeper understanding of C facilitates learning the other languages, as its programming principles can be generalized to the others. For that reason, this entry focuses on C, providing programming principles, sample code, compilation, and applications to educational research, measurement, and evaluation. Programming Principles in C Programming Languages follow paradigms or ways of writing code at different levels of abstraction (i.e., how closely the language resembles the binary machine code of 0s and 1s). C follows an imperative (and more specifically, procedural) paradigm, which means that the code describes how to perform a task. C code accomplishes tasks using functions, a term that bears similarity to the mathematical definition. Functions use input to produce output, although this is not always the case. Some functions perform tasks with no explicit input values required, and others use input to perform a task with no specific output values...

  • Technology and Workflows for Multiple Channel Content Distribution
    eBook - ePub

    Technology and Workflows for Multiple Channel Content Distribution

    Infrastructure implementation strategies for converged production

    • Philip J. Cianci(Author)
    • 2012(Publication Date)
    • Routledge
      (Publisher)

    ...Data and the functions that modified were independent and had to be explicitly linked and called by the program. This and other poor programming practices led to “spaghetti-code” where logical program flow was ignored. Consequently, applications ran slower than they should and crashed (Listing C.1). C++ Researchers at Bell Labs weren't finished yet. In 1979, Bjarne Stroustrup began work on C with Classes. His goal was to enhance the C Programming Language. Originally he had been assigned the task of analyzing the UNIX kernel. As luck would have it, UNIX was written in C. When working on his PhD thesis, Stroustrup found that other contemporary languages had features that were appropriate for large software development, but were slow; others were fast but too low-level to be suitable to large-scale software development. This led him to the idea of enhancing the C language with Simula-like features. C was chosen because it is general-purpose, fast, portable, and widely used. (Probably didn't hurt that it too was developed at Bell Labs.) In 1983, it was renamed C++. Enhancements started with the addition of classes, followed by—among other features—virtual functions, operator overloading, multiple inheritance, templates, and exception handling. The first commercial release occurred in October 1985. FIGURE C.2 Event-driven processing Event-driven applications A technique first implemented in the design of the UNIX operating system has been expanded to modern, multitasking, Windows-based systems. The idea is that small programs, called “daemons” or “listeners,” run in the background waiting for “events” to occur. When a relevant event happens, the daemon/listener initiates an action and the “handler” takes appropriate action. Figure C.2 illustrates the concept. Using this technique, a programmer never really has to check to see if a key has been pressed, or an icon clicked...

  • Principles of Quantitative Development
    • Manoj Thulasidas(Author)
    • 2012(Publication Date)
    • Wiley
      (Publisher)

    ...At times, however, we have to tweak the compiler or linker options, which requires us to know what is involved at each step. A developer writes his code almost always in a high- level language, such as C, C++, etc. These languages are human-readable, however cryptic they may look to the uninitiated. For instance, a simple declaration such as int n = 0 ; (in C or C++) indicates to the human developer that he has access to a memory location that he has labelled n, and that it can take integer values. Hidden from his view are the steps necessary to allocate this memory location and keep track of it, and to move a zero integer value into it. These steps are machine-dependent operation codes (opcodes), which are mere series of binary numbers, completely unintelligible to a human being. Compilation is the process by which the source code written in a high-level language (such as C, C++, etc.) is translated to a low-level machine language and optimized. The compiler, a program by itself, first launches a language preprocessor (to handle macros and other preprocessor directives in C, for instance). Then it does a lexical analysis, followed by more thorough syntax and semantic checks. Then it optimizes the code, finally generating a machine-readable code called the object (not to be confused with the object in the OOP paradigm). This intermediate object file, which needs to be ‘linked’ before running, has an. o or. obj extension. On a Unix-like machine, a compiler such as the GNU C compiler (gcc) is invoked with a command like gcc -c file.c -o file.o, which instructs the machine to compile file.c and put the output (the object file) in file.o. The source code (file.c) can be edited using any text editor such as emacs, vi, notepad etc. On the VAX computer of yester year, which came with its own C compiler, a similar command CC FILE.C would create FILE.OBJ out of the source code file...