Showing posts with label Tricks. Show all posts

c

 

  Introduction to Data structure  

Data structure is a way to organized data in some way so that we can perform operations on the data in effective way.
Some examples are listed below.
    Image result for Data Structure  , C Programing
  • Link List.
  • Stack.
  • Queue.
  • Tree.
  • Graph.
  • Hash Table.
We select data structure according to need that is-
1) Size of data.
2) Amount of data.

 

For Implementing Data structure We need to understand Dynamic Memory Allocation 

 

 

Pointers - A pointer is  variable which contain the  memory address of another variable. 

 Declaration Of Pointer variable -

int a;  // Normal variable Declaration
int *a; // Pointer Variable Declaration

Operators Of Pointer -

  •  &  - Address Operator 
  •  *    - Value at the address operator 

Example of Pointer -

 #include<stdio.h> // Header files
Void main()
{
int a=5;
int  *p ;
p = &a ;
printf("\n %d",a);         // 5
printf("\n %d",p);         // address 25001
printf("\n %u",&a);      //25001
printf("\n %u",&a);      // 25002
printf("\n %d",*p);       // 5
printf("\n %d",*(&a));  // 5
return 0;
}

Dynamic Memory Allocation

Image result for Data Structure  , Dynamic Memory Allocation  , C Programing
The process allocating at the time of execution is called dynamic memory allocation. The allocation and releasing  of the memory space can be done with the use of some built in functions. 
  • sizeof() 
  • malloc()
  • calloc()
  • free()

sizeoff() 

 The size of operation is use to find the  size  of argument in terms of byte . the argument can be  variable or any data type.
Example.
int a[10] ;
sizeof(a);      // 20
sizeof(float); // 4 

malloc() 

This function is use to allocate the memory space.
Syntax - ptr =(data type *) malloc( specific size) ;
Example.
ptr =(int*) malloc(10) ;

Calloc()

This function is used to allocate the multiple blocks of memory.
syntax - ptr = (int*) calloc( number of block , size of block ) ;
Example.
ptr =(int*) calloc ( 5 , 2) ; // this allocate 5 blocks , each of 2 bytes 

free()

This function is use to release the memory spaces.
Syntax - free(ptr);
Example.
free(ptr) ; // memory set to free 

we would like to have an interactive session. comment your questions below.

Be updated Be safe !

Cheers !!



Image result for Convert RPM  To DEB Package



DEB or Debian Package is an installation package which is compatible to Ubuntu and Ubuntu Based Operating Systems while
RPM or Red-hat Package Manager is an installation package which is compatible to RedHat Based Operating Systems.

And sometimes just sometimes we get stuck with the other kind of file in the the other kind of system, but not to worry mostly you can just convert the file to the other format by following these simple steps.


For converting RPM To DEB you have to follow these steps


  1. First we need a software package which is available on Ubuntu Based Systems. Run below command to install alien and other essentials.
    sudo apt-get install alien dpkg-dev debhelper build-essential
  2. Now we convert the file run:
    sudo alien path/filename.rpm
  3. Now we can install the deb file just run:
    sudo dpkg -i path/filename.deb

For converting DEB To RPM you have to follow these steps

  1. Firt we need a software package which is available on Red-hat Based Systems. Run below command to install alien and other essentials.
    yum -y install alien
  2. Now we convert the file run:
    sudo alien -r path/filename.deb
  3. Now we can install the deb file just run:
    sudo rpm -Uvh path/filename.rpm



Well everything is just really about compatibility, if all the dependencies are satisfied then you are good to go.


we would like to have an interactive session . comment your questions below

Be Updated Be Safe  !

Cheers !!


 

Image result for Servers, Clients, and PortsThere are various host computers on the Internet which offer services to other systems on the Internet. Computers that offer services for other system to use their services called servers. Server contain all the records of all machines connected to it

Server computer is the main component used in networking. And gives the virtual access to the host computer

Here are some types of servers and clients that you may meet

 Mail servers

Mail server are responsible for mailing activities of the system. Post Office
Protocol (POP) servers (or POP3 servers) store incoming mail,

Image result for Servers, Clients, and Ports while Simple Mail Transfer Protocol (SMTP) servers relay outgoing mail.
 Web servers

Store Web pages and send them in response to requests from
Web clients, which are usually called browsers.


 FTP servers
Store files that you can transfer to or from your computer if you
have a FTP client.

 

Image result for Servers, Clients, and Ports New servers

Store Usenet newsgroup articles that you can read and send if

you have a new client or newsreader.

 IRC servers


Act as a switchboard for Internet-based online chats. To take part, you use an IRC client.

Image result for Servers, Clients, and PortsThere are some standard numbers for port which used throughout the internet. Some widely used ports listed below
Port 21 FTP (file transfer)
Port 23 Telnet (remote log in)
Port 25 SMTP (mail relaying)
Port 80 World Wide Web
Port 110 POP3 (storage of incoming mail)
Port 194 (as well as 6667 and many others) IRC (online chat)
Port 532 Usenet newsgroups (discussion groups)

We would like to have an interactive session. Comment your questions below

Be Updated Be Safe !

Cheers !!

Image result for Microcontroller 

Integrated Circuit Which consist of A processor, Memories,Peripherals, Input & Output is termed as Microcontroller . That is it contain .

 

 

Image result for Processor 

 


Processor for calculation needed in arithmetic and logical operations

Image result for RAM 

Memory such as Read Only Memory (ROM) and Random Access Memory (RAM) for memory operations ,

Image result for PeripheralsPeripherals to support the processor and to extend its capabilities,

 

 

 

Image result for i/o devices 

 

Input and Output to communicate with the world . Such as Key board for typing ,mouse for selecting , speaker

All the above terms together functioning is termed as a microprocessor and when it started working as system all together that system is termed as Microcontroller


The very first single-chip processor was built and proposed by Intel Corporation in 1971 under the name Intel 4004. It was a 4-bit central processing unit (CPU). As i can not mention all that processors you visit http://en.wikipedia.org/wiki/PIC_microcontroller for more information on the evaluation of processors


We would like to have an interactive session . Comment your questions below


Be Updated Be Safe !


Cheers !!

 

 








Welcome to My Blog

Popular Post

- Copyright © Technopits -Powered by Blogger