1. Basics (theory)
float < double
# integer can be stored in float or double
----------
string s;
getline(cin,s); // now we can input space separated words
-------------------------------------------------------------------
characters: ' ' strings: " "
-----------------------------------------------------------------------
Array elements stored in consecutive memory address.
array contains data of similar data type. e.g., integer array can't have floating numbers
EVEN IF WE ENTER FLOATING NUMBERS IN IT THEN THEY WILL GET TRIMMED TO INT.
locations which are not defined by you in an array, assigns themselves garbage value.
---------------------------------------------------------------------------
pass by reference mein we just add a (&) symbol before defining parameters in function
ARRAYS are by default set to PASS BY REFERENCE
-------------------------------------------------------------------------------
int x=65465;
cout<<sizeof(x) // tells size of datatype in bytes
---------------------
bool, char-- 1 byte
short-- 2 bytes
int/float-- 4 bytes
long/ long long/ double-- 8 bytes
-------------------------
Returning Multiple Values From a Function-
return {a,b,c,d}
------------------------------------------------
Comments
Post a Comment