Tutorial An Explanation Of C

  • Thread starter Deleted member 205
  • Start date
  • Tags
    c
D

Deleted member 205

Guest
What Is C?
Invented at AT&T Bell Labs(Now 'Nokia Bell Labs') in 1972 by Dennis Ritchie(Deceased since 2011). Unlike many other Languages,
C is a Procedural-Language. So, there are no such thing as Classes or Inheritance or Generics. C is purely based on
Functions, If-Else Statements, Loops and Switches. There are no bits of Object-Oriented in it, even years after it's
creation.

C is commonly found being used in the development of Operating-Systems, Embedded-Systems and Software.

C also influenced the Syntax and development of modern-day Programming-Languages including Java, C++, PHP, Perl and
Rust. Many of these Languages are also implemented using C.

History of C
Dating all the way back to the beginning of development on the UNIX Kernel in 1969, C's History largely relates to
UNIX. UNIX was originally written in Assembly on a PDP-7 by Dennis Ritchie(Creator of C) and Ken Thompson(Creator of
B and UTF-8
). UNIX was then ported over to a PDP-11, still written in Assembly.

Wanting to make Utilities for UNIX, Thompson was looking for a Programming-Language for the job. First, Thompson
tried to develop his own FORTRAN Compiler but gave up on it. Then, a Language by the name of 'BCPL' was released.
Thompson then modified BCPL's Syntax to be less confusing and thus' the B Programming-Language was made. But this
was later dumped as B was too slow and was not able to take advantage of the PDP-11's features.

In 1972, Dennis Ritchie, decided to pick-up the B Programming-Language and slowly improve on it. As time went on,
this lead to the creation of C and thus' the Language and it's Compiler was included in Version 2 of the UNIX Kernel.
In 1973, with the release of Version 4 of the UNIX Kernel, most of the Kernel had been re-done in C but still contained
bits of Assembly in it's source-code. UNIX was now the world's first Kernel to be implemented in a Language that was
not Assembly.

C Usage
Back in the 70's and 80's, C was used everywhere. From Operating-Systems and Kernels to Computer-Software and
other kinds of Devices. But, with the release of C++ and Java, C's usage did start to decline a bit with most Software
now being done in C++ or Java but C still found popularity in niche areas.

In recent years though, C has started to be picked-up more with it mainly being used in Embedded-Systems and with
more and more people contributing to the development of the Linux Kernel(Which is written almost entirely in C, just
like UNIX. But, it's 'UNIX-like' and not actually based on UNIX
).

C is still used in manu popular pieces of Computer-Software. Many of the GNU Software are written in C. OpenGL and
OpenAL are also written in C.

C continues to be used around in the world in both old and new Software.

How Do I Get/Learn C?
If you have a GNU/Linux System, you'll already have GCC(GNU-Compiler-Collection) which can be used to Compile C-Code
(It can also Compile C++-Code). You don't need to install anything on a GNU/Linux System.

If you're on Windows then try installing MinGW. There are many guides and resources online to help you install MinGW.
Although, if you want to save yourself some pain and time then Microsoft's Visual Studio IDE(Not Visual Studio Code),
comes with support for C and C++ and comes with it's own Compiler for the Language. But, it's best to try having a shot
at installing MinGW anyway.

For MacOS, you'll have Apple's own Clang Compiler which Compiles both C and C++ Code. Use that.

For learning C, it's best to grab a Book on it. One of the Books favoured by many C Programmers is The C Programming
Language by Dennis Ritchie and Brian W. Kernighan.
This Book has been essentially dubbed as an essential Book for
learning C. It presents many examples for you to learn from and teaches you the essentials of C and can also be used
as a reference for C's Standard-Libraries.
 
Last edited by a moderator:
D

Deleted member 205

Guest
So, an explanation of C++ like the one you did for C would be appreciated. I know C++ has classes, but don't understand the point of them yet.
Hey there.

I generally would do one on C++. But, as with what I did for Lua and now C, I will only explain the history, usage and how to start using the Language. I won't explain things like Classes in the Post. Classes and Methods are a feature and deserve a Thread of their own. They aren't easy to learn, understand or explain either.

I do know quite a bit about Java and I'm still continuing to further learn the Language and it's features. But, Java and C++ both handle Classes and Methods differently but are quite similar in terms of Syntax.

Again, I don't know C++ so I can't really explain it. Also, C++ has many more things other than Classes including Abstraction, Objects, Constructors, Inheritance, Vectors and Polymorphism.

So, sorry.