- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1401 Articles for C
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
3K+ Views
Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. They are defined as a collection of nodes. Here, nodes have two parts, which are data and link. The representation of data, link and linked lists is given below −Operations on linked listsThere are three types of operations on linked lists in C language, which are as follows −InsertionDeletionTraversingInsertionConsider an example, wherein we insert node 5 in between node 2 and node 3.Now, insert node 5 at the beginning.Insert node 5 at the end.Insert node 5 at the end.Note:We cannot insert node 5 before node 2 as the ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
18K+ Views
Stack is a linear data structure, where data is inserted and removed only at one end.AlgorithmsGiven below is an algorithm for Push ( ) −Check for stack overflow.if (top = = n-1) printf("stack over flow");Otherwise, insert an element into the stack.top ++ a[top] = itemGiven below is an algorithm for Pop ( ) −Check for stack underflow.if ( top = = -1) printf( "stack under flow");Otherwise, delete an element from the stack.item = a[top] top --Given below is an algorithm for Display ( ) −if (top == -1) printf ("stack is empty");Otherwise, follow the below mentioned algorithm.for (i=0; i='0' && ch
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
1K+ Views
Stack is a linear data structure, where data is inserted and removed only at one end.AlgorithmsGiven below is an algorithm for Push ( ) −Check for stack overflow.if (top = = n-1) printf("stack over flow");Otherwise, insert an element into the stack.top ++ a[top] = itemGiven below is an algorithm for Pop ( ) −Check for stack underflow.if (top = = -1) printf("stack under flow");Otherwise, delete an element from the stack.item = a[top] top --Given below is an algorithm for Display ( ) −if (top == -1) printf ("stack is empty");Otherwise, follow the below mentioned algorithm.for (i=0; i
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
496 Views
Data structure is collection of data organized in a structured way. It is divided into two types as explained below −Linear data structure − Data is organized in a linear fashion. For example, arrays, structures, stacks, queues, linked lists.Nonlinear data structure − Data is organized in a hierarchical way. For example, Trees, graphs, sets, tables.QueueIt is a linear data structure, where the insertion is done at rear end and the deletion is done at the front end.The order of queue is FIFO – First In First OutOperationsInsert – Inserting an element into a queue.Delete – Deleting an element from the ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
676 Views
File is collection of records or is a place on hard disk, where data is stored permanently.Operations on filesThe operations on files in C programming language are as follows −Naming the fileOpening the fileReading from the fileWriting into the fileClosing the fileSyntaxThe syntax for opening a file is as follows −FILE *File pointer;For example, FILE * fptr;The syntax for naming a file is as follows −File pointer = fopen ("File name", "mode");For example, fptr = fopen ("sample.txt", "r"); FILE *fp; fp = fopen ("sample.txt", "w");Error Handling in FilesSome of the errors in files are as follows −Trying to read beyond ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
3K+ Views
File is collection of records or is a place on hard disk, where data is stored permanently.Operations on filesThe operations on files in C programming language are as follows −Naming the fileOpening the fileReading from the fileWriting into the fileClosing the fileSyntaxThe syntax for opening a file is as follows −FILE *File pointer;For example, FILE * fptr;The syntax for naming a file is as follows −File pointer = fopen ("File name", "mode");For example, fptr = fopen ("sample.txt", "r"); FILE *fp; fp = fopen ("sample.txt", "w");fgets( ) and fputs( ) functions fgets() is used for reading a string from a file.The ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
10K+ Views
File is collection of records or is a place on hard disk, where data is stored permanently. Operations on files The operations on files in C programming language are as follows − Naming the file Opening the file Reading from the file Writing into the file Closing the file Syntax The syntax for opening a file is as follows − FILE *File pointer; For example, FILE * fptr; The syntax for naming a file is as follows − File pointer = fopen ("File name", "mode"); For example, fptr ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
10K+ Views
A file represents a sequence of bytes, regardless of it being a text file or a binary file. File is collection of records or is a place on hard disk, where data is stored permanently. Operations on files The operations on files in C programming language are as follows − Naming the file Opening the file Reading from the file Writing into the file Closing the file Syntax The syntax for opening a file is as follows − FILE *File pointer; For example, FILE * fptr; The ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
551 Views
File is collection of records or is a place on hard disk, where data is stored permanently.Need of filesEntire data is lost when a program terminates.Storing in a file preserves the data even if, the program terminates.If you want to enter a large amount of data, normally it takes a lot of time to enter them all.We can easily access the content of files by using few commands.You can easily move your data from one computer to another without changes.By using C commands, we can access the files in different ways.Operations on filesThe operations on files in C programming language ... Read More
![Bhanu Priya](https://www.tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg)
773 Views
File is collection of records or is a place on hard disk, where data is stored permanently.Need of filesEntire data is lost when a program terminates.Storing in a file preserves the data even if, the program terminates.If you want to enter a large amount of data, normally it takes a lot of time to enter them all.We can easily access the content of files by using few commands.You can easily move your data from one computer to another without changes.By using C commands, we can access the files in different ways.Operations on filesThe operations on files in C programming language ... Read More