Found 26504 Articles for Server Side Programming

Explain read mode operation of files in C language

Bhanu Priya
Updated on 24-Mar-2021 13:25:59

994 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

Difference Between Copy Constructor and Assignment Operator in C++

Ravi Ranjan
Updated on 20-May-2025 13:31:25

11K+ Views

A copy constructor is a type of constructor that uses another object from the same class that has been created previously, to initialize an object, whereas the assignment operator is used to assign a value to a variable. In this article, we will understand the difference between the copy constructor and the assignment operator in C++. Copy Constructor A copy constructor creates a new object by copying an existing object of the same class which has been created previously. It is of two types, i.e., Default and User-defined copy constructor. In the default copy constructor, ... Read More

Difference Between Checked and Unchecked Exception in Java

AmitDiwan
Updated on 24-Mar-2021 13:17:47

14K+ Views

In this post, we will understand the difference between checked and unchecked exceptions in Java.Checked ExceptionsThey occur at compile time.The compiler checks for a checked exception.These exceptions can be handled at the compilation time.It is a sub-class of the exception class.The JVM requires that the exception be caught and handled.Example of Checked exception- ‘File Not Found Exception’Unchecked ExceptionsThese exceptions occur at runtime.The compiler doesn’t check for these kinds of exceptions.These kinds of exceptions can’t be caught or handled during compilation time.This is because the exceptions are generated due to the mistakes in the program.These are not a part of the ... Read More

Explain write mode operation of files in C language

Bhanu Priya
Updated on 24-Mar-2021 13:22:38

916 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

How to separate even and odd numbers in an array by using for loop in C language?

Bhanu Priya
Updated on 24-Mar-2021 13:18:59

2K+ Views

An array is a group of related data items that are stored with single name.For example, int student[30]; //student is an array name that holds 30 collection of data items with a single variable nameOperations of arraySearching − It is used to find whether particular element is present or notSorting − It helps in arranging the elements in an array either in ascending or descending order.Traversing − It processes every element in an array sequentially.Inserting − It helps in inserting the elements in an array.Deleting − It helps in deleting an element in an array.The logic to find even numbers ... Read More

How to perform arithmetic operations on two-dimensional array in C?

Bhanu Priya
Updated on 24-Mar-2021 13:17:01

3K+ Views

An array is a group of related data items that are stored with single name.For example, int student[30]; //student is an array name that holds 30 collection of data items with a single variable nameOperations of arraySearching − It is used to find whether particular element is present or notSorting − It helps in arranging the elements in an array either in ascending or descending order.Traversing − It processes every element in an array sequentially.Inserting − It helps in inserting the elements in an array.Deleting − It helps in deleting an element in an array.The logic applied to perform arithmetic ... Read More

Difference Between Interface and Abstract Class in Java & C#

AmitDiwan
Updated on 24-Mar-2021 13:13:43

703 Views

In this post, we will understand the difference between abstract class and interface in Java and C#.Abstract ClassIt contains the declaration and definition part.Multiple inheritance can’t be implemented using abstract class.It contains the constructor.It can also contain some static members.It can contain multiple types of access modifiers such as public, private, protected.The performance of an abstract class is very good, because it is quick.It is used to implement the core identity/functionality of a class.A class can use only one abstract class.If many implementations are same, and they have a common behaviour, it is suggested to use an abstract class.Abstract classes ... Read More

How to perform the arithmetic operations on arrays in C language?

Bhanu Priya
Updated on 24-Mar-2021 13:12:55

4K+ Views

An array is a group of related data items that are stored with single name.For example, int student[30]; //student is an array name that holds 30 collection of data items with a single variable nameOperations of arraySearching − It is used to find whether particular element is present or notSorting − It helps in arranging the elements in an array either in ascending or descending order.Traversing − It processes every element in an array sequentially.Inserting − It helps in inserting the elements in an array.Deleting − It helps in deleting an element in an array.The logic to perform all arithmetic ... Read More

C program to replace all occurrence of a character in a string

Bhanu Priya
Updated on 24-Mar-2021 13:12:15

8K+ Views

Enter a string at run time and read a character to replace at console. Then, finally read a new character that has to be placed in place of an old character where ever it occurs inside the string.Program1Following is the C program to replace all occurrence of a character − Live Demo#include #include int main(){    char string[100], ch1, ch2;    int i;    printf("enter a string : ");    gets(string);    printf("enter a character to search : ");    scanf("%c", &ch1);    getchar();    printf("enter a char to replace in place of old : ");    scanf("%c", &ch2);    for(i = 0; i

Difference Between ref and out in C#

AmitDiwan
Updated on 24-Mar-2021 13:09:58

906 Views

In this post, we will understand the difference between ‘ref’ and ‘out’ in C#.Ref keywordBefore passing the parameters to ‘ref’, they need to be initialized.It is not necessary to initialize the value of the parameter before it returns to the calling method.The data can pass in two directions when the ‘ref’ keyword is used.It is useful when the called method needs to change the value of the parameter that is passed.Out keywordIt is not required to initialize parameters before it is passed to ‘out’.It is required to initialize the value of a parameter before it is returned to the calling ... Read More

Advertisements