Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

C++

Initializing Arrays ........................................................................................................................................... 92

Accessing Array Elements .............................................................................................................................. 93

Arrays in C++ .................................................................................................................................................. 94

Passing Arrays to Functions ........................................................................................................................... 98

17. STRINGS ............................................................................................................................ 104

The C-Style Character String ........................................................................................................................ 104

The String Class in C++ ................................................................................................................................. 106

18. POINTERS .......................................................................................................................... 108

What are Pointers? ...................................................................................................................................... 108

Using Pointers in C++ ................................................................................................................................... 109

Pointers in C++ ............................................................................................................................................. 110

Null Pointers ................................................................................................................................................ 111

Pointer Arithmetic ....................................................................................................................................... 111

Pointers vs Arrays ........................................................................................................................................ 115

Array of Pointers.......................................................................................................................................... 117

Pointer to a Pointer ..................................................................................................................................... 119

Passing Pointers to Functions ...................................................................................................................... 120

Return Pointer from Functions .................................................................................................................... 123

19. REFERENCES...................................................................................................................... 126

References vs Pointers ................................................................................................................................. 126

Creating References in C++ .......................................................................................................................... 126

References as Parameters............................................................................................................................ 127

Reference as Return Value ........................................................................................................................... 129

20. DATE AND TIME ................................................................................................................ 131

Current Date and Time ................................................................................................................................ 132

Format Time using struct tm ........................................................................................................................ 133

You might also like