0% found this document useful (0 votes)
3 views4 pages

C

The document provides a comprehensive overview of C++ programming concepts, including data types, operators, loops, functions, and memory management. It highlights key features such as boolean values, type conversion, arrays, and built-in functions. Additionally, it covers important programming principles like pass by value, pass by reference, and prime number checking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

C

The document provides a comprehensive overview of C++ programming concepts, including data types, operators, loops, functions, and memory management. It highlights key features such as boolean values, type conversion, arrays, and built-in functions. Additionally, it covers important programming principles like pass by value, pass by reference, and prime number checking.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Some important points about c++ ~

1. At c++, false is stored as 0 and true is stored as 1 at memory.


2. While showing the cout of false, we get 0 only and for truw we get 1.
3. Boolean values at c++ are not written in capitalized format.
4. Double data type is the double of float data type.

5. (Primitive Data Types)-


*int (4 bytes)
*char (1 bytes)
*float (4 bytes)
*bool (1 byte)
*double (8 bytes)

6. Type conversion is an implicit process and casting is an explicit process.


7. Casting of char value to integer value is possible at c++.
8. At c++, char value are only enclosed within single quots.

9. (Garbage Values)- These are those types of values which are empty and when it
cout then it would
always give us random values.Either it is positive or
negative.

10. <cin> and <cout> are not functions rather they are global objects.
11. There are 3 types operators at c++- Arithmatic operators, logical operators and
relational operators.

12. (logical operators)- <OR>--> (||)~which is known as pipe~"Logical OR"


<AND>--> (&&)~which is also known as double ampersend or
just say double-AND~"Logical AND"
<NOT>--> (!)~"Logical NOT"

13. At the word Binary, 'Bi' means 2. At the word Unary, 'U' means only 1.

14. (Binary operators)-The type of operator where it at-least uses 2 values to


perform any operation.
(Unary operator)-The type of operator where is uses only 1 value to perdorm any
operation.

15. Incriment unary operator-> ++


Decrement unary operator-> --

16. (a++) or (a--)-> first performs the operation then update.It is known as post-
increment operator.
(++a) or (--a)-> first update then perform the operation.It is known as pre-
increment operator.

17. <else-if> is used with <if> and <else> if there are multiple conditionals then
it is used.
18. Uppercase character ascii value is 65 to 96 and Lowercase character ascii value
is 97 to 122.
19. ASCII stands for "American Standerd Code of Information Interchange".
20. (Ternary statements)- Here Ternary means 3. Ternary statement is nothing but a
single statement
version of conditionals.It is followed by <?> for the
condition.And different
statement based on a condition are seperated by the
<:>.
eg- int m = 3;
m < 5 ? "pos" : "neg";
*This type of statement is generally used for <if-else>
condition but if <else if>
is also needed then it is not used in action.

22. At c++, there are 3 types of loops- <while>loop, <for>loop and <do-while>loop.

21. Example syntax of whil,for and do-while loop-


(while-loop)~ (for-loop)~ do{
while(i <= 5){ for(int j=0; j<=5; j++){
//process
cout << i << endl; cout << j << endl; }while(i
<= 5); //condition
i++; }
}
*At while, the out return is alsways shown at vertical manner but if the user
wants to output return
horizontal manner then this statement is written-> <cout << i << " ";>.

22. camelCase is a type of case of naming of variables where the first word of the
identifier is small case and the second
word of the identifier is at Uppercase where the words are not seperated by
a space.

23. do-while loop performs the operation first then checks the condition.
24. C++ has built-in function for finding factorial of any any number.It is
factorial().
25. At both C or C++, a return value of 0 means success(<return 0;>) and return
value of 1 means failiure(<return 1;>).
26. factorial is denoted by the symbol <!> with that number-> <n!> this is n
factorial.
27. Patterns are those types of special program whcih are made up of loops and
nested loops only.
28. In continuous pattern problems, we take a variable and store the last progress
done by every iteration then start with that value at the next iteration.
29. In c++, you cannot directly compare C-style strings with == for condition
check. Instead you need to use the <strcmp()> the <cstring>library Or just include
the string-
library and use the string data type instead of char data type.

30. (Arrays)-Arrays are considered to be the first Data Structures.


*Data storers are of different different types and those different
formats of storage of data is known as data structure, like arrays which
whcih strores data is a type of data structures.
*At arrays, each block of code occupies a space of 4 bytes.
*At c++, size() and sizeof() gives us different outputs.
size() gives us the length of array.
sizeof() gives us the memory occupied by the array.

(Properties of arrays)~
1. We can store data only of same type of data type at every block
of an array.
2. Arrays are contiguous in memory.
3. Arrays are lenear(straight line structures).
4. Every block of an array occupies a space of a single integer.
5. If we want to initialize the size of an array to a fixed length
then we can or if we dont then there is no problem(according to the length of the
array, the size would be initialized).
31. (Algorithms)- It is a form of efficient method of performing operation on a
particular set of data. Those diffrent methods are
known as algorithms. It is also a method of searching of data
i.e is only an operation.

32. In c++, positive infinity is written as <INT_MAX> and the negative infinity is
written as <INT_MIN>.

33. There is a built in function for checking that whether a string contains
alphanumeric characters or not.
syntax- <isalnum()>.

34. There is a built in function for converting a uppercase character to lower


case. <tolower()>.

35. In c++ for representing the <n> factorial, we represent it as <n!> means to
take the product of all the values from 1 ro n.

36. Based on the context of c++, memory is of two types, stack and heep.

37. When all the operations and execution is performed after returning all the
desired output, all the stack frames are erased hence,
all the memory is cleared and ready for next code.

38. Copy of arguement by different place holders(different variables) or same palce


holders(same variables) is passed to
function is known as "Pass by Value" and "Pass by Reference",respectively.

39. <const>type is used before any data type variable or value to make it
completely constant type means even initialization would not
change the value of that variable even it is <int>, <float> etc. If it
is initialized then compiler would show us an error.

40. A variable identifier with all caps idicates that the variable value is a
constant, a lateral value.

41. For finding whether a number is prime or not, four conditions must be checked~
if n <= 1, then it is not prime number.
if n % 2 or n % 3 != 0, then it is a prime number.
if n % 2 or n % 3 == 0, then it is not a prime number.
if n == 2 or n == 3, then it is a prime number.
*But there are certain numbers which are not divisible by 3 and 2 but then also
they are not prime.

{C++ built-in-functions}~~
1. In c++, we are provided with built function for finding the maximum or minimum
between any number or say values in an array of nums.
For comparing about the maximum value, we use the <max()>. And for minimum
is <min()>.

2. <count()>- For using this function, first the algorithm library must be
included.THis function could be used for counting the number of occurence of a
particular
number in an array.

3. <find()>- This function is used for finding the indicis of any particular
number. For using this we iterate from the begining to end
and then the target is declared. For using this function, first
algorithm library must be included.
(syntax)- int* idx_cont = find(begin(array_nums),
end(array_nums), small_val);

4. <change()>- This funciton could be sued for changing the value of any variable
at its original format. This is widely used at
functions specially at Pass by Reference.

5. <lower()>- This function is used to convert an upper case character into lower
case character.

6. <isalnum()>- This function is used to check whether a string contains


alphanumeric characters or not.

7. <sqrt()>- For using this function, first the cmath library must be added. This
function
could be used for finding the square root of any number.

{Functions}~
(syntax of a function)-
returntype printhello(){
//operation.
}
here, <returntype> is the type of data which we are returning from a function.
<printhello()> is the name of the function.
1. Functions which does not return anything, the there return type must becout <<
"Greater: " << sum(10, 5) << endl; <void>.
2. A function does not works until and unless we do not call the function. That is
function call or say function invoke.
3. The Inputing of any variable inside of a function is known as parameters.

{unique points and definition}-


(*). (Fibonacci)- The process of increasing of list of numbers in such a way that
the next number is greater
the previous number by its own value.

{About Binary number system}-


1. The number 10 is only known as "dec" at the decimal terminology.
2. Number system are of numerous types but all of them, Binary number system is the
most prominent one.
3. For conversion from decimal to binary, we need to repeatedly divide any number
by 2.
4. The coded format of any binary number system have some tricks to solve- The
solution is mainly based the modulu or say the remeinder
of the continuous repitition of the division of 2 with the next remeinder.

You might also like