STRUCTURES AND POINTERS Introduction to Structures A structure is a user-defined data type that allows to combine data items of different types under one name. It is used to represent a record (like a student, employee, book, etc.) Syntax struct StructureName { dataType member1; dataType member2; ... }; E…
Read moreReferences and Functions Reference A reference is an alias (another name) for an existing variable. Once a reference is created, it cannot be changed to refer to another variable. Definition syntax: datatype &reference_name = variable_name; Example: int a = 10; int &ref = a; // ref is a reference to a Both a …
Read morePassing a Pointer as an Argument Introduction pass arguments to a function in three ways : Call by Value Call by Reference Call by Pointer Mainly focus on Call by Pointer à Passing the address of a variable by & operator to a function. Inside the function, a pointer parameter receives this address and can dire…
Read more
Social Plugin