238 Assignment
238 Assignment
C Programming
1.
2.
When you mul ply these two integers, the result (6,000,000) exceeds the maximum value of a 32-bit
signed integer, causing integer overflow. This results in an incorrect value being stored in z.
3.
The statement doesn't work because the second argument to the strcat func on must be a string,
not a single character.
4.
The sizeof operator provides the size of the array in bytes. By dividing the total size of the array by
the size of one element, you can calculate the number of elements.
C++ Programming
1.
Explana on- The code creates a class `Sample` with a dynamically allocated integer (`ptr`), but lacks a
deep copy constructor, causing a **double delete** when a copy of the object is passed to
`SomeFunc`, leading to **undefined behavior**. To fix it, implement a deep copy constructor to
ensure each object manages its own memory safely.
2.
The parameter added to every non-sta c member func on when it is called is this.
this is an implicit pointer to the current object, represen ng the instance on which the
member func on is called.
Data Structures
2. List out the areas in which data structures are applied extensively.
Data structures are extensively used in algorithms, databases, compilers, networking,
ar ficial intelligence, opera ng systems, and more.
Unix
2. What is 'inode'?
An inode is a data structure used in UNIX file systems to store informa on about a file, such
as its size, owner, permissions, and loca on on the disk.
DBMS
1. What is a database?
A database is a collec on of structured data that is stored and managed in a way that allows
efficient access, modifica on, and retrieval.
o Primary Key
o Foreign Key
o Candidate Key
o Unique Key
Opera ng System
SQL
1. Which is the subset of SQL commands used to manipulate Oracle Database structures,
including tables?
The subset is Data Defini on Language (DDL), which includes commands like CREATE, ALTER,
and DROP.
Computer Networks