Programming – Week 2
|
This week we worked with pointers in C++. You create a pointer by adding a This is an example of how pointer can be used:
#include
void main()
{
int variable = 5;
int* pointer = &variable;
std::cout << "Address: " << pointer << "nValue: " << *pointer;
std::cin.get();
}
We also started a new project to create the classic Pong game. In order to create a window and draw graphics we use a library called SDL (Simple DirectMedia Layer). By using functions and data types from SDL library we could create our own window and graphics-renderer. |