Posts

Showing posts from 2017

A Brief Understanding of Pointers you must read

Image
A Brief Understanding of Pointers in C Programming Posted by   Shivendra kumar The  computer’s memory is a sequential collection of storage cells. Each cell, commonly known as a byte, has a number called   address  associated with it. Typically, the addresses are numbered consecutively, starting from zero. The last address depends on the memory size. A computer system having 64k memory will have its last address as 65,535.   Whenever we declare a variable in our programs, the system allocates somewhere in the memory, an appropriate location to hold the value of the variable. This location will have its own address number. Consider the following example: The above statement  int var  creates a location in the memory to hold integer value. That location will have an address for example assume it is 5000. The statement  var = 200  stores the value 200 at the location whose address is 5000. So, in our example,  var  i...

C And C++ Programming Languages — Biggest Differences

Image
C And C++ Programming Languages — Biggest Differences And Comparison April 14, 2016 Short Bytes:  C vs C++ — which one is better? What is a procedural programming language and what is a modular programming language? Which one should be used for better and faster output? Well, we answer all the aspects of using C vs C++ against each other in this article. C Programming language is said to be the mother of most of the most famous languages. However, the next generations and child languages took over C very easily. Among all the programming languages, C is the most talked language against all. Let’s take a deeper look into the same and know why and how these languages are different. C vs C++: Comparison and differences Structural or procedural C is a structural or procedural programming language whereas C++ is a modular or an object-oriented programming language. Let’s look at it this way: Let’s imagine, you are building up a house in...

What are security issues in the C language?

Image
What are security issues in the C language? I recently read about two of them: 1.   Buffer Overflow:   It happens when data written to a buffer (chunk of memory) overflows and gets overwritten onto the adjacent memory due to lack of proper boundary checks. Let me show you something - consider the following code that I tried on  Compile and Execute C Online, (An Online C Compiler) : You can clearly see that I have allocated memory for  only 8 integers  in the array 'a', but I have tried to access and modify the value corresponding to 10th integer in array 'a' (a memory location that belongs to some other entity). Certainly, anything this unethical must not be allowed, right guys... but the output is quite surprising, isn't it: Then, I got a little more ambitious and tried the following: and I got the utmost feared   segmentation fault: So,   what happened   ? Well, C wil...