C++ Flashcards
What is the difference between C and C++
The main difference is that C is a procedural programming language and does not support classes and objectd, while C++ is a combination of both procedural and object-orientated programming languages.
Is C a procedural language or an object orientated language?
Procedural
Is C++ a procedural language or an object orientated language?
object orientated
what are #include … lines called
pre-processor directives
include
contains functions for
converting data from one type to another
random number generators
memory managment
sorting
include
functions for performing input and output operations
include
resizeable arrays
include
allows you to manipulate strings
how to add a line below hello world when ouputted
std::cout
1)
std::cout
include
finding minimum and maximums
What is the difference between a Float and a Double
A float has 32 bit precision for a floating number.
A double has 64 bit precision for a floating number.
A double is more precise and requires more memory.
print hello world using printf()
printf(“hello world”)
printf(“%c”, ?)
A character e.g ‘A’
printf(“%d”,?)
interger e.g 10
printf(“%.3f”,?)
Three decimal place float