SN.
|
Structure
|
Union
|
1
|
Struct keyword is used to make structure variable
|
Union keyword is
used to make structure variable
|
2
|
Structure is user defined data type which is used frequently to
represent real word data type presentation.
|
Union is also a user defined data type which is used to achieve specific
need.
|
3
|
Structure allocates memory for its all member.
|
Union allocates memory only for the biggest data member.
|
4
|
All member data can be hold at same time in a structure variable.
|
Only one data from member can be hold at a time.
|
5
|
Several members can be initialized at ones.
|
Only first member can be initialized.
|
Wednesday, 15 July 2020
Difference between Union & Structure
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Tuesday, 14 July 2020
File writing program append mode using Command Line Argument
Q : Write a program using command line parameters to append one text file to another text file.?
Answer :
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main(int argc,char *argv[])
{
FILE *infile,*outfi
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday, 13 July 2020
Bitwise Operator Complete solution
Bitwise operators are used to perform bit operations. Decimal values are converted into binary values which are the sequence of bits and bit wise operators work on these bits. Bit wise operators in C language are given below.
1. & (bitwise AND)
2. | (bitwise OR)
3. ~ (bitwise NOT)
4. ^ (XOR)
5. << (left shift)
6. >> (right shift).
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Link List Disadvantage
- If fix element is required for an operation then link list is not a good option because it’s consumed more memory to manage the dynamic address for the list.
- Random traversal is not possible in link list due to dynamic memory allocation which is unpredictable and scarred in memory.
- Reverse traversing is not possible in a single link list because only the next pointer is used to point next element.
- Manual delete is required because link list uses memory in heap section.
- Infinite traversal occurred in a circular list if not handled properly.
- More Time and memory required compare to array.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Subscribe to:
Posts (Atom)