There are many IDE(Integrated Development Environment) available for C programming language, but I would prefer using Code::Blocks or Visual Studio Editor.
For this video tutorial series we’ll be using Code::Blocks.
You can visit CodeBlocks website and navigate to Downloads section, and then to Binaries section and depending upon your Operating System, download the IDE and install it. Downloading and installation of Code::Blocks is shown in the video posted below. You can follow along and get started with programming in C language.
Above program is just an example. You need not worry if you didn’t understand it. I’ll be explaining it in the next video, in detail. For now, if possible type the program as it is and try to compile and execute it on your own by seeing the video. Try to change the content inside printf function and run compilation(Build) and execution(Run) once again and see the results for yourself.
Note: 1. Code::Blocks is available for all the popular Operating Systems. So whatever I show in the video tutorial is applicable for everyone irrespective of the OS they’re using.
2. Code::Blocks comes with C/C++ compiler, so you need not install compiler or any other plugins separately.
3. Make sure to download the latest version of the IDE. And make sure the file you download has ( codeblocks-17.12mingw-setup ) mingw in it. That’s how we can know it comes shipped with c/c++ compiler by default.
Let’s know a little bit of history of C programming. Many of you may not be interested in knowing the history of C – you maybe here just to learn how to get started with Coding in C Program. I understand that. You’ll want to know the history soon, once you learn the basics of C programming. History is very important. But for now I’ll let you know about it in 1 line!
History of C Programming Language
C Programming language was developed at AT&T’s Bell Lab in 1972. It was designed and developed by a man called Dennis Ritchie (September 9, 1941 – October 12, 2011).
Why name it as C? Before designing C, there was a programming language called “B”. So Dennis Ritchie named it as “C”. Little did he know “C Programming” language would get so popular among programmers – even after 3 decades of its inception.
Why Learn C As A First Programming Language?
Beginners tend to get into arguments/discussion as to how C++, C#, Java has improved upon C and how “Object Oriented Programming” has so many advantages over C. But let me tell you, Operating Systems like Windows, iOS, OSx, Unix/Linux(Kernel), android are all written in C. Looks like there is something which is good in C because of which companies like Microsoft, Apple, Unix/Linux Foundation, Google are choosing C Programming language to develop and maintain their Operating Systems. These are only a few popular companies I’ve listed. There are many many companies solely dependent upon C programming for their software development. We’ll learn more along the course of these video tutorials.
1. Object Oriented Programming(OOP) method present in C++, C#, Java provides a huge advantage for programmers. But the basic programming elements like looping, variables, declaration, arithmetic operations, logical operations etc are almost similar to what you learn in C. Learning C definitely gives you an extra edge before jumping on to learn C++ or C# or Java.
2. Programs written in C are very efficient. It’s performance and speed of execution is unique. Even today device drivers are written in C for this reason. The code is compact and has high performance even in low memory availability.
3. Your smartphone, digital camera, washing machine, microwave oven, refrigerator, smart bulbs, smart fans etc you name it, all these have microprocessors attached to it, which has program embedded in it. Since these micro-processor in these devices have limited memory and need to respond to user inputs instantly, the program of choice is inevitably C, in most cases.
4. Most 3D gaming frameworks like “DirectX” are built using the C Programming language. Because for good gaming experience speed of execution matters a lot. Since C programs are robust, reliable and fast these 3D gaming framework choose C programming over others. Even animation special effects in movies are done using C programs.
5. Its flexible and portable: Since C program allows user to handle memory directly we can write programs very flexibly according to our needs. We can manage memory flexibly. “Portable” because the same program source code works on all operating systems without the need for much modification. All Operating System have C Compiler and they compile and give object code and executable which suits and works for that particular OS.
6. Did you know, many compilers and interpreters for other languages like FORTRAN, Pascal, Perl, Python etc are written in C. Why is it so? As I told you before, C is reliable, portable and fast.
7. Using C programming language we can directly access hardware. This is very powerful feature. We’ll discuss this in detail in coming video tutorials.
8. C program enables programmer to manipulate individual bits of memory. But “with power comes responsibility” – we need to handle memory carefully or else we may end up writing code which might behave abruptly. For this reason Java has its own builtin memory management feature called Garbage Collection.
9. C implementation has a large library of useful functions. Ex: scanf, printf, functions to write data to file etc.
10. C programming language is easy to learn and understand.
We can go on and keep writing advantages of learning C Program. But let me stop here and assure you that you’re in the right place and C is the best choice as your first programming language to learn.
Make sure to practice all the programs we post here and quickly you’ll know the advantage for yourself. And soon you’ll be an advanced user and if you keep learning you’ll be an expert.
There are many Job opportunities for people who are experts in C Programming Language. We’ll even post Job Board shortly and try to list job offers for C program experts. Stay tuned for all the good stuff we’ll post on this page: C Programming: Beginner To Advance To Expert
Request
Please let us know some advantages and disadvantages or anything informative about C programming language in the comment section below. This will be helpful for others joining you on later date to start learning ‘C Programming language’. Sharing is caring. Also please share this article with your friends and followers on Social Media.
C is a general-purpose, procedural computer programming language. C reduces the gap between high level language and low level language. Hence C is known as Middle Level Language. You can know more about C in brief in our first video tutorial posted below.
“The best way to learn a new programming language is by writing programs in it.” – Dennis Ritche
Follow the order in which it is post below and make sure to practice all the tutorials. Even simple programs need to be written and executed by you, so that it gets into your subconscious memory :)
If you got to learn anything from our website, then please do not forget to share this page with your friends on Facebook, LinkedIn, Twitter etc..
This list also includes tutorials for your college exams, viva and campus interview questions. We have gone through and regularly keep ourselves updated with interview questions of TCS, Infosys, Wipro, Tech Mahindra, HCL, olta, Cyient, Oracle Financial Services, Mphasis, Mindtree, Microsoft, IBM, Google, Apple etc.
Please support us by sharing this page with your friends on social media sites. Also stay subscribed to our blog and YouTube channel.
Major Changes To Note Previously we use to import Storage class inside src/app/app.module.ts file and we would list it as one of the providers. But now we need to import IonicStorageModule class inside src/app/app.module.ts file and list it inside imports array. That’s the only difference in implementing Ionic Storage, everything else is as described in Ionic Storage: Ionic 2 video tutorial.
In this video tutorial only concentrate on src/app/app.module.ts file and for implementing storage set and get method refer Ionic Storage: Ionic 2 video tutorial itself.
Now implementing get and set methods wherever we need it. Practically it would be useful inside a data provider file, but in this tutorial am implementing inside a normal page, so that I keep the complexities out for this basic lesson.
Here we import Storage class and create an instance of it. We check if the storage is ready. Once its ready it returns/resolves a promise. So now we can set value using this.storage.set() method. We can set an object, an array or a strong value or simply a number.
We can get the value by using its get method, which returns the value stored in the key as promise. If nothing is stored in the key, it returns null.
Today lets learn about an important project which helps us use 130+ native mobile SDK features in our Ionic application through simple JavaScript interfaces – Ionic Native.
Ionic Native is a TypeScript wrapper for Cordova/PhoneGap plugins that make adding any native functionality you need to your Ionic 2 mobile app easy. Ionic Native wraps plugin callbacks in a Promise or an Observable, providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.
There are two steps required to use Ionic Native in our project 1. Install the Ionic Native package for each plugin you want to add. 2. Install the plugin using Cordova or Ionic CLI.
For example: If we want to add AdMob plugin to our application: Step 1: Add/ Install Specific Ionic Native package
npm install --save @ionic-native/ad-mob
npm install --save @ionic-native/ad-mob
Step 2: Add / install the plugin using Cordova or Ionic CLI.
ionic plugin add cordova-plugin-admobpro
ionic plugin add cordova-plugin-admobpro
Additional Implementation Listing Plugin Class as Provider: src/app/app.module.ts
Look at the first import statement in above code snippet. We import AdMob plugin and the way we import is specific to ad-mob and we do not import the whole ionic native script here – thus saving application load time.
Also specify the class name as provider. Because we use the services provided by this class in our application.
Working of plugin: src/app/app.component.ts
import { AdMob } from '@ionic-native/ad-mob';
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { HomePage } from '../pages/home/home';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = HomePage;
constructor(public admob: AdMob, platform: Platform) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.admob.createBanner({
adId: 'ca-app-pub-5732334124058455/4262868443',
isTesting: false,
autoShow: false
}).then(() => {
this.admob.showBanner(8);
});
});
}
}
import { AdMob } from '@ionic-native/ad-mob';
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { HomePage } from '../pages/home/home';
@Component({ templateUrl: 'app.html'
})
export class MyApp { rootPage:any = HomePage; constructor(public admob: AdMob, platform: Platform) { platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. this.admob.createBanner({ adId: 'ca-app-pub-5732334124058455/4262868443', isTesting: false, autoShow: false }).then(() => { this.admob.showBanner(8); }); }); }
}
Again, we import AdMob native code wherever we want to implement the service of this plugin. We create instance of the class we want to implement – as constructor argument. Then inside platform.ready() method we call the methods of these classes and implement its services inside our project.
Trouble Shoot 1. If you’re getting ‘plugin not found‘ error. OR Cannot find module “@ionic-native/ “ errors, then follow below commands to fix it.
npm rebuild
npm install
npm rebuild
npm install
2. Error Message “Provider Not Found: Make sure to include all the specific packages inside src/app/app.module.ts file and list its class name inside providers array.