Programming Flashcards
What are the advantages of using pointer?
*makes program simple
*reduces program length
*enhances execution speed
*helps in allocation and deallocation.
What are string handling functions? Explain any 4
built-in functions in programming languages that manipulate and process strings.
*strcpy() : It can copy the content of one string to another
*strcat() : It is used to join two strings
*strcmp() : can compared to strings
*strlwr() : can convert the string to lowercase
Classify the different types of decision making statements.
There are two types of decision making statements
*if statement: helps u execute a block of code if the condition is true
*if-else statement: helps u to execute the block of code if the condition is true and another block of code if the condition is false.
*nested if statement: it is an if statement inside an if statement.
*switch statement: allows u to select one of many code blocks based on the value of the variable.
What are multidimensional array
arrays with more than one dimension, used for tables and mattresses
Define array
An array is a data structure that allows you to store multiple values of Same data type in contiguous block of memory
syntax
data_type array_name [size]
initialization int arr[5]={1,2,3,4,5};
Define Union
user defined data type that allows different variables to be stored in the same memory location.
Difference between arrays and pointers
ARRAYS
*An array is a data structure that allows you to store multiple values of Same data type in contiguous block of memory
*They cannot be modified
*initialisation is done while defining them
*nature is statistic
*allocation is done at compile time
POINTER
*Variables that store memory address
*they cannot be initialised while defining them
*nature is dynamite
*allocation is done at the runtime
Difference between arrays and pointers
ARRAYS
*An array is a data structure that allows you to store multiple values of Same data type in contiguous block of memory
*They cannot be modified
*initialisation is done while defining them
*nature is statistic
*allocation is done at compile time
POINTER
*Variables that store memory address
*they cannot be initialised while defining them
*nature is dynamite
*allocation is done at the runtime