User Tools

Site Tools


cplusplus:pointers_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cplusplus:pointers_2 [2016/03/05 22:38] mithatcplusplus:pointers_2 [2017/03/21 23:53] – [Pointers as function parameters] mithat
Line 3: Line 3:
 Pointers and comparisons, functions, and qualifiers.((Portions loosely adapted from: Pointers and comparisons, functions, and qualifiers.((Portions loosely adapted from:
 Deitel, Harvey M., and Paul J. Deitel. "Pointers and Strings." In //C++: How to Program//. 3 ed. Upper Saddle River, NJ: Prentice Hall, 2001. 304-388.)) Deitel, Harvey M., and Paul J. Deitel. "Pointers and Strings." In //C++: How to Program//. 3 ed. Upper Saddle River, NJ: Prentice Hall, 2001. 304-388.))
- 
-<WRAP center round important 60%> 
-This content has not been vetted for C++11 compliance. 
-</WRAP> 
- 
 ===== Comparing pointers ===== ===== Comparing pointers =====
  
Line 28: Line 23:
  
 <file cpp function-with-pointer.cpp> <file cpp function-with-pointer.cpp>
-/** Demostrates how to pass pointers to functions. */+/** Demonstrates how to pass pointers to functions. */
 #include <iostream> #include <iostream>
 using namespace std; using namespace std;
Line 152: Line 147:
  
 <WRAP center round tip 90%> <WRAP center round tip 90%>
-One way to remember this is "const modifies the thing immediately following it." In the case of:+One way to remember this is //"''const'' modifies the thing immediately following it."// 
 + 
 +In the case of:
 <code c++>int *const myPtr = &x;</code> <code c++>int *const myPtr = &x;</code>
 ''const'' modifies ''myPtr'', meaning the value of ''myPtr'' is constant. In the case of: ''const'' modifies ''myPtr'', meaning the value of ''myPtr'' is constant. In the case of:
cplusplus/pointers_2.txt · Last modified: 2019/03/28 16:55 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki