C/C++

Filing in C (part 2)

Submitted by Muzammil Muneer on

Writing in a File

In this part you will learn: 1. C syntax 2. Filing 3. Writing to a File In this tutorial we will learn about filing in C. Filing is a very important tool in C. In this program we will write data in a file. We will take input from the user and write that data in a file whose name will be entered by the user. Writing in a File Basic Step: Open Dev C++ then File > new > source file and start writing the code below.

How to Use Operators Overloading with Arrays in C++

Submitted by PhoeniciansSy on
We want to implement array class with the following specifications: - range checking. - array assignment. - arrays that know their size. - compare arrays using '==' and '!=' operators. In the next example we will implement a simple class for integers is called Array, it has the previous specifications, and it has the following structure:
  1. cl

Filing in C

Submitted by Muzammil Muneer on

Reading From a File

In this part you will learn: 1. C syntax 2. Filing 3. Reading from a file In this tutorial we will learn about filing in C. Filing is a very important tool in C. In this program we will read a file from our computer and display its content on the screen.

Structures in C

Submitted by Muzammil Muneer on

Structures in C

In this part you will learn: 1. C syntax 2. Structure variable 3. Structure declaration 4. Structure accessing 5. Showing output

What is a Structure?

Structure is a user-defined data type in C which allows you to combine different data types to store a particular type of record. Structure helps to construct a complex data type in a more meaningful way. Structure helps when you have to store a collection of data of many similar things or people etc. It is somewhat similar to an array.

Functions And Pointers in C Language

Submitted by Muzammil Muneer on

Functions and Pointers

In this part you will learn: 1. C syntax 2. Pointers 3. Pointers declaration 4. Function arguments as pointers 5. Showing output In this tutorial we will use pointers with functions. Using functions with pointers is same as using functions with any normal variable. The only difference comes in the parameter list and sometimes in the return type as well when we return a pointer or an address of a variable. Calculating Average Open Dev C++ then File > new > source file and start writing the code below.

Introduction to Pointers

Submitted by Muzammil Muneer on

Introduction to Pointers

In this part you will learn: 1. C syntax 2. Pointers 3. Pointers declaration 4. Showing output

What is a Pointer?

Whenever we declare variable our computer stores it in at a memory location in the memory. A unique address is assigned to every variable made by the user either its on run time or compile time. We use pointers to access those address whenever we want to and use the value that is stored on that particular address. Pointer is a special kind of variable. Pointers are designed to store the memory address i.e.

Object-Oriented Programming In C++: Friend Function

Submitted by PhoeniciansSy on

Friend Function:

Is a function that: 1. is not a member of a class. 2. has access to the class's private and protected members. 3. is considered as a normal external function that is given special access privileges. 4. is not in the class's scope. 5. is not called using the member-selection operators (. and –>) unless they are members of another class. 6. is declared by the class that is granting access. We can define a friend function anywhere in the class declaration.