SlideShare a Scribd company logo
What is the difference between break & continue?
The break statement will immediately jump to the end of the current block of
code.
The continue statement will skip the rest of the code in the current loop block and
will return to the evaluation part of the loop.
break will exit the loop completely, but continue will just stop the current iteration.
i.e. Continue will skip the rest of the code and goes for another iteration in the
loop.

What is the difference between structure & union?

1. Union allocates the memory equal to the maximum memory required by the
member of the union but structure allocates the memory equal to the total
memory required by the members.
2.

In union, one block is used by all the member of the union but in case of
structure, each member has their own memory space.

3.

Union is best in the environment where memory is less as it shares the memory
allocated. But structure can not implement in shared memory.

4.

As memory is shared, ambiguities are more in union, but less in structure.

5. Self referential union cannot be implemented in any datastructure, but self
referential structure can be implemented.

What is self referential structure?
It is exactly what it sounds like: a structure which contains a reference to itself. A common
occurrence of this is in a structure which describes a node for a linked list. Each node needs a
reference to the next node in the chain.
struct linked_list_node {
int data;
struct linked_list_node *next; // <- self reference
};
A self-referential structure is a data structure that includes references to other data of its same
type. A simple example of this would be an implementation in C of a linked list:
typedef struct listnode {
void *data;
struct listnode *next;
} list_t;

The reference to a listnode struct from within a listnode struct is the self-referential aspect of
the structure.

Q: What is the difference between binary and text files?
While both binary and text files contain data stored as a series of bits
(binary values of 1s and 0s), the bits in text files represent characters,
while the bits in binary files represent custom data. While text files
contain only textual data, binary files may contain both textual and
custom binary data.

Mode Description
r

Opens an existing text file for reading purpose.

w

Opens a text file for writing, if it does not exist then a new file is created. Here your program will
start writing content from the beginning of the file.

a

Opens a text file for writing in appending mode, if it does not exist then a new file is created.
Here your program will start appending content in the existing file content.

r+

Opens a text file for reading and writing both.

w+

Opens a text file for reading and writing both. It first truncate the file to zero length if it exists
otherwise create the file if it does not exist.

a+

Opens a text file for reading and writing both. It creates the file if it does not exist. The reading
will start from the beginning but writing can only be appended.

More Related Content

Viewers also liked

7юрий гугнин
7юрий гугнин7юрий гугнин
7юрий гугнинOntico
 
Pro Exercise Connect
Pro Exercise ConnectPro Exercise Connect
Pro Exercise Connect
Pro Exercise Connect
 
(Leçon 151.12.1)
(Leçon 151.12.1)(Leçon 151.12.1)
(Leçon 151.12.1)
Pierrot Caron
 
Estudo sobre o rim
Estudo sobre o rimEstudo sobre o rim
Estudo sobre o rim
Sueli Biondo Biondo
 
1. pengenalan teknologi-informasi
1. pengenalan teknologi-informasi1. pengenalan teknologi-informasi
1. pengenalan teknologi-informasi
Andi Kusuma
 
Форс банковские системы
Форс банковские системыФорс банковские системы
Форс банковские системыEgor Sulkin
 
7юрий гугнин
7юрий гугнин7юрий гугнин
7юрий гугнинOntico
 
Geld
Geld Geld
Rajeev gandhi grameen vidyutikaran yojna
Rajeev gandhi grameen vidyutikaran yojnaRajeev gandhi grameen vidyutikaran yojna
Rajeev gandhi grameen vidyutikaran yojna
Malay Gupta
 
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
IftikharUddin Syed CRISC, EHCE, ITIL, M.S. IT Security
 
Trabajo extraclase grupo e
Trabajo extraclase grupo eTrabajo extraclase grupo e
Trabajo extraclase grupo e
yefema
 
Inteligencia emocional
Inteligencia emocional Inteligencia emocional
Inteligencia emocional
carmenauristela
 
Talent Profile
Talent ProfileTalent Profile
Talent Profile
Jason Watts, CDM, CFPP
 
Torax normal en Imagenología
Torax normal en ImagenologíaTorax normal en Imagenología
Torax normal en Imagenología
Nery Josué Perdomo
 
Tips to help you kick start your weight loss
Tips to help you kick start your weight lossTips to help you kick start your weight loss
Tips to help you kick start your weight loss
rida habib chorfa
 

Viewers also liked (18)

7юрий гугнин
7юрий гугнин7юрий гугнин
7юрий гугнин
 
Pro Exercise Connect
Pro Exercise ConnectPro Exercise Connect
Pro Exercise Connect
 
(Leçon 151.12.1)
(Leçon 151.12.1)(Leçon 151.12.1)
(Leçon 151.12.1)
 
Estudo sobre o rim
Estudo sobre o rimEstudo sobre o rim
Estudo sobre o rim
 
Kohus
KohusKohus
Kohus
 
Wayers
WayersWayers
Wayers
 
1. pengenalan teknologi-informasi
1. pengenalan teknologi-informasi1. pengenalan teknologi-informasi
1. pengenalan teknologi-informasi
 
Форс банковские системы
Форс банковские системыФорс банковские системы
Форс банковские системы
 
Servesafe
ServesafeServesafe
Servesafe
 
7юрий гугнин
7юрий гугнин7юрий гугнин
7юрий гугнин
 
Geld
Geld Geld
Geld
 
Rajeev gandhi grameen vidyutikaran yojna
Rajeev gandhi grameen vidyutikaran yojnaRajeev gandhi grameen vidyutikaran yojna
Rajeev gandhi grameen vidyutikaran yojna
 
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
I Syed, Sr. Consultant - Enterprise Information Security Governance, Risk, Co...
 
Trabajo extraclase grupo e
Trabajo extraclase grupo eTrabajo extraclase grupo e
Trabajo extraclase grupo e
 
Inteligencia emocional
Inteligencia emocional Inteligencia emocional
Inteligencia emocional
 
Talent Profile
Talent ProfileTalent Profile
Talent Profile
 
Torax normal en Imagenología
Torax normal en ImagenologíaTorax normal en Imagenología
Torax normal en Imagenología
 
Tips to help you kick start your weight loss
Tips to help you kick start your weight lossTips to help you kick start your weight loss
Tips to help you kick start your weight loss
 

Similar to Structure & union

Linked Lists in Python, Python Institute in Delhi.pdf
Linked Lists in Python, Python Institute in Delhi.pdfLinked Lists in Python, Python Institute in Delhi.pdf
Linked Lists in Python, Python Institute in Delhi.pdf
ESS Institute
 
Core Java Interview Questions with Answers.pdf
Core Java Interview Questions with Answers.pdfCore Java Interview Questions with Answers.pdf
Core Java Interview Questions with Answers.pdf
SudhanshiBakre1
 
C#
C#C#
Intervies
InterviesIntervies
Intervies
roopa manoharan
 
All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questions
Asad Masood Qazi
 
Unit 3
Unit 3Unit 3
Unit 3
TPLatchoumi
 
Index Structures.pptx
Index Structures.pptxIndex Structures.pptx
Index Structures.pptx
MBablu1
 
What is c language
What is c languageWhat is c language
What is c language
Kushaal Singla
 
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptxUnit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
vekariyakashyap
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)
Umar Ali
 
Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated) Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated)
Umar Ali
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
Excellence Academy
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
Jeff Smith
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
Jeff Smith
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
Jeff Smith
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
Jeff Smith
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
Jeff Smith
 
Nagaraju
NagarajuNagaraju
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++  Langauage Training in Ambala ! BATRA COMPUTER CENTREC++  Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Java Basics
Java BasicsJava Basics
Java Basics
Farzad Wadia
 

Similar to Structure & union (20)

Linked Lists in Python, Python Institute in Delhi.pdf
Linked Lists in Python, Python Institute in Delhi.pdfLinked Lists in Python, Python Institute in Delhi.pdf
Linked Lists in Python, Python Institute in Delhi.pdf
 
Core Java Interview Questions with Answers.pdf
Core Java Interview Questions with Answers.pdfCore Java Interview Questions with Answers.pdf
Core Java Interview Questions with Answers.pdf
 
C#
C#C#
C#
 
Intervies
InterviesIntervies
Intervies
 
All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questions
 
Unit 3
Unit 3Unit 3
Unit 3
 
Index Structures.pptx
Index Structures.pptxIndex Structures.pptx
Index Structures.pptx
 
What is c language
What is c languageWhat is c language
What is c language
 
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptxUnit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
Unit_6StructureandUnionpptx__2023_01_04_16_48_56.pptx
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)
 
Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated) Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated)
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 
Nagaraju
NagarajuNagaraju
Nagaraju
 
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++  Langauage Training in Ambala ! BATRA COMPUTER CENTREC++  Langauage Training in Ambala ! BATRA COMPUTER CENTRE
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
 
Java Basics
Java BasicsJava Basics
Java Basics
 

Recently uploaded

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 

Structure & union

  • 1. What is the difference between break & continue? The break statement will immediately jump to the end of the current block of code. The continue statement will skip the rest of the code in the current loop block and will return to the evaluation part of the loop. break will exit the loop completely, but continue will just stop the current iteration. i.e. Continue will skip the rest of the code and goes for another iteration in the loop. What is the difference between structure & union? 1. Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members. 2. In union, one block is used by all the member of the union but in case of structure, each member has their own memory space. 3. Union is best in the environment where memory is less as it shares the memory allocated. But structure can not implement in shared memory. 4. As memory is shared, ambiguities are more in union, but less in structure. 5. Self referential union cannot be implemented in any datastructure, but self referential structure can be implemented. What is self referential structure? It is exactly what it sounds like: a structure which contains a reference to itself. A common occurrence of this is in a structure which describes a node for a linked list. Each node needs a reference to the next node in the chain. struct linked_list_node { int data; struct linked_list_node *next; // <- self reference };
  • 2. A self-referential structure is a data structure that includes references to other data of its same type. A simple example of this would be an implementation in C of a linked list: typedef struct listnode { void *data; struct listnode *next; } list_t; The reference to a listnode struct from within a listnode struct is the self-referential aspect of the structure. Q: What is the difference between binary and text files? While both binary and text files contain data stored as a series of bits (binary values of 1s and 0s), the bits in text files represent characters, while the bits in binary files represent custom data. While text files contain only textual data, binary files may contain both textual and custom binary data. Mode Description r Opens an existing text file for reading purpose. w Opens a text file for writing, if it does not exist then a new file is created. Here your program will start writing content from the beginning of the file. a Opens a text file for writing in appending mode, if it does not exist then a new file is created. Here your program will start appending content in the existing file content. r+ Opens a text file for reading and writing both. w+ Opens a text file for reading and writing both. It first truncate the file to zero length if it exists otherwise create the file if it does not exist. a+ Opens a text file for reading and writing both. It creates the file if it does not exist. The reading will start from the beginning but writing can only be appended.