Arjun Thakur has Published 1109 Articles

What is the C# equivalent of C++ friend keyword?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:53:12

2K+ Views

friend in C#A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.A friend can be a ... Read More

How to open a plain text file in C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:44:26

244 Views

To open a plain text file, use the StreamReader class. The following opens a file for reading −StreamReader sr = new StreamReader("d:/new.txt")Now, display the content of the file −while ((line = sr.ReadLine()) != null) {    Console.WriteLine(line); }Here is the code −Example Live Demousing System; using System.IO; namespace FileApplication { ... Read More

Class and Static Variables in C#

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:38:08

8K+ Views

Static variables are used for defining constants because their values can be retrieved by invoking the class without creating an instance of it. Static variables can be initialized outside the member function or class definition. You can also initialize static variables inside the class definition.Example Live Demousing System; namespace StaticVarApplication ... Read More

What is the use of ON COMPLETION PRESERVE clause while creating the event?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:37:00

2K+ Views

As we know that an event is automatically dropped when it is expired and we would not be able to see it from SHOW EVENTS statement. To change such kind of behavior we can use ON COMPLETION PRESERVE while creating the event. It can be understood from the following example ... Read More

How to implement Traversal in Singly Linked List using C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:26:27

370 Views

Set a linkelist collection −var list = new LinkedList();Now, add elements −list.AddLast("One"); list.AddLast("Two"); list.AddLast("Four");Now, let us add new elements in the already created LinkedList −LinkedListNode node = list.Find("Four"); list.AddBefore(node, "Three"); list.AddAfter(node, "Five");Let us now see how to traverse through the nodes in a Singly Linked List −Exampleusing System; using System.Collections.Generic; ... Read More

How to initialize a tuple to an empty tuple in C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:20:26

2K+ Views

To initialize a tuple to an empty tuple −Tuple myTuple;If you want to check for values in a tuple, that whether it is null or not −Exampleusing System; namespace Demo {    class Program {       static void Main(string[] args) {          Tuple ... Read More

How we can find all the triggers associated with a particular MySQL table?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 12:04:06

71 Views

We can find all the triggers associated with a particular table with the help of the following query −mysql> Select * from INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'query'AND EVENT_OBJECT_TABLE = 'Student_info'\G *************************** 1. row ***************************            TRIGGER_CATALOG: def             TRIGGER_SCHEMA: query     ... Read More

Microwave Transmission

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 11:09:37

11K+ Views

In the electromagnetic spectrum, waves within the frequencies 1GHz to 300GHz are called microwaves.Features of MicrowavesMicrowaves travel in straight lines, and so the transmitter and receiver stations should be accurately aligned to each other.Microwave propagation is line – of – sight propagation. So, towers hoisting the stations should be placed ... Read More

Communication Satellites

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 11:08:50

15K+ Views

A communication satellite is an artificial satellite that acts as a large repeater in the sky. It receives signals from the source transmitter, amplifies using transponders, and relays them to the receiver. Thus, it creates a communication channel between locations of the earth that would not have been able to ... Read More

How to convert an array of characters into a string in C#?

Arjun Thakur

Arjun Thakur

Updated on 22-Jun-2020 11:01:48

135 Views

Let us first set an array of 5 characters −char[] ch = new char[15]; ch[0] = 'T'; ch[1] = 'r'; ch[2] = 'i'; ch[3] = 'c'; ch[4] = 'k';Now convert them into a string −string str = new string(ch);Here is the complete code −ExampleUsing System; class Program {    static ... Read More

Advertisements