Showing posts from July, 2015

Implementing Vector - C Programming Tutorial

In this c programming tutorial we are going to see code for implementing vector in c language or creating array of size N (Any size array) in language. So let’s proceed, in this c programming tutorial we’re just going to create a dynamically sized array of integers. Here’s what the definition of a vector interface might look like: // vector.h#define VECTOR_INITIAL_CAPACITY 100// Define a vector typetypedef struct { int size; // slots used so far int capacity; // total available slots int *data; // array of integers we're storing} Vector;void vector_init(Vector *vector);void vector_append(Vector *vector, int value);int vector_get(Vector *vector, int index);void vector_set(Vector *vector, int index, int value);void vector_double_capacity_if_full(Vector *vector);void vector_free(Vector *vector); Note that we are writing this code in header file and we will be calling it vector.h Implementing Vector Below is the code for implementation of the interface we defined (vector.h

Why we need IPv6 ?

IPv6, the successor standard to IPv4, for existing networks that currently use IPv4 communications could solve the basic problem of the availability of only approximately 4.3 billion IPv4 addresses. Ceasing use of IPv4 addresses and only using IPv6 addresses, however, is impractical and thus maintaining an environment that enables mutual communication between IPv4 and IPv6 (dual stack environment) will be required for a certain period. Completing IPv6 support is therefore considered to require a large amount of both time and money. IPv6 addresses the main problem of IPv4, that is, the exhaustion of addresses to connect computers or host in a packet-switched network. IPv6 has a very large address space and consists of 128 bits as compared to 32 bits in IPv4. Therefore, it is now possible to support 2^128 unique IP addresses, a substantial increase in number of computers that can be addressed with the help of IPv6 addressing scheme. It is widely expected that the Internet will use IPv4 a