diff options
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.qdoc')
-rw-r--r-- | src/corelib/tools/qvarlengtharray.qdoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc index d68e8a1..996ca7f 100644 --- a/src/corelib/tools/qvarlengtharray.qdoc +++ b/src/corelib/tools/qvarlengtharray.qdoc @@ -35,12 +35,12 @@ The C++ language doesn't support variable-length arrays on the stack. For example, the following code won't compile: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.qdoc 0 + \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 0 The alternative is to allocate the array on the heap (with \c{new}): - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.qdoc 1 + \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 1 However, if myfunc() is called very frequently from the application's inner loop, heap allocation can be a major source @@ -53,7 +53,7 @@ it is much faster than heap allocation. Example: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.qdoc 2 + \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 2 In the example above, QVarLengthArray will preallocate 1024 elements on the stack and use them unless \c{n + 1} is greater @@ -223,7 +223,7 @@ be used to access and modify the items in the array. Example: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.qdoc 3 + \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 3 The pointer remains valid as long as the array isn't reallocated. |