Blog Section

C Introduction

Introduction

 

What is C?

Dennis Ritchie developed the general-purpose computer language C at Bell Labs in 1972. Despite being an ancient language, it is quite popular. As the UNIX operating system was created using C, the two are closely related. Free-form code is found in the C programme source. Statements are separated by semicolons, while blocks of statements are grouped using curly brackets.


Why Learn C?

  • It is one of the most popular programming language in the world
  • If you know C, you will have no problem learning other popular programming languages such as Java, Python, C++, C#, etc, as the syntax is similar
  • C is very fast, compared to other programming languages, like Java and Python
  • C is very versatile; it can be used in both applications and technologies

Difference between C and C++

  • C++ was developed as an extension of C, and both languages have almost the same syntax
  • The main difference between C and C++ is that C++ support classes and objects, while C does not

Get Started

This tutorial will teach you the basics of C. It is not necessary to have any prior programming experience. The following traits are also present in the C programming language:

  • The language has a small, fixed number of keywords, including a full set of control flow primitives: if/elsefordo/whilewhile, and switch. User-defined names are not distinguished from keywords by any kind of sigil.
  • It has a large number of arithmetic, bitwise, and logic operators: +,+=,++,&,||, etc.
  • More than one assignment may be performed in a single statement.
  • Functions:
    • Function return values can be ignored, when not needed.
    • Function and data pointers permit ad hoc run-time polymorphism.
    • Functions may not be defined within the lexical scope of other functions.
    • Variables may be defined within a function, with scope.
    • A function may call itself, so recursion is supported.
  • Data typing is static, but weakly enforced; all data has a type, but implicit conversions are possible.
  • User-defined (typedef) and compound types are possible.
    • Heterogeneous aggregate data types (struct) allow related data elements to be accessed and assigned as a unit.
    • Union is a structure with overlapping members; only the last member stored is valid.
    • Array indexing is a secondary notation, defined in terms of pointer arithmetic. Unlike structs, arrays are not first-class objects: they cannot be assigned or compared using single built-in operators. There is no “array” keyword in use or definition; instead, square brackets indicate arrays syntactically, for example month[11].
    • Enumerated types are possible with the enum keyword. They are freely interconvertible with integers.
    • Strings are not a distinct data type, but are conventionally implemented as null-terminated character arrays.
  • Low-level access to computer memory is possible by converting machine addresses to pointers.
  • Procedures (subroutines not returning values) are a special case of function, with an untyped return type void.
  • Memory can be allocated to a program with calls to library routines.
  • A preprocessor performs macro definition, source code file inclusion, and conditional compilation.
  • There is a basic form of modularity: files can be compiled separately and linked together, with control over which functions and data objects are visible to other files via static and extern attributes.
  • Complex functionality such as I/O, string manipulation, and mathematical functions are consistently delegated to library routines.
  • The generated code after compilation has relatively straightforward needs on the underlying platform, which makes it suitable for creating operating systems and for use in embedded systems.

While C does not include certain features found in other languages (such as object orientation and garbage collection), these can be implemented or emulated, often through the use of external libraries (e.g., the GLib Object System or the Boehm garbage collector). Timeline of C language

Year Informal name[11] C Standard
1972 Birth  
1978 K&R C  
1989/1990 ANSI C, ISO C ISO/IEC 9899:1990
1999 C99 ISO/IEC 9899:1999
2011 C11, C1x ISO/IEC 9899:2011
2018 C17 ISO/IEC 9899:2018
2023* C23, C2x

Guys please don’t forget to like and share the post.Also join our WindowsTechno Community and where you can post your queries/doubts and our experts will address them . You can also share the feedback on below windows techno email id. If you have any questions feel free to contact us on admin@windowstechno.com also follow us on facebook@windowstechno to get updates about new blog posts.

How useful was this post?

Click on a star to rate it!

As you found this post useful...

Follow us on social media!

Was this article helpful?
YesNo

Vipan Kumar

He is an Active Directory Engineer. He has been working in IT industry for more than 10 years. He is dedicated and enthusiastic information technology expert who always ready to resolve any technical problem. If you guys need any further help on subject matters, feel free to contact us on admin@windowstechno.com Please subscribe our Facebook page as well website for latest article. https://www.facebook.com/windowstechno

Leave a Reply

Back to top button