Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
doc_src_qvarlengtharray.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5
int
myfunc
(
int
n
)
6
{
7
int
table
[
n
+ 1];
// WRONG
8
...
9
return
table
[
n
];
10
}
12
13
15
int
myfunc
(
int
n
)
16
{
17
int
*
table
=
new
int
[
n
+ 1];
18
...
19
int
ret
=
table
[
n
];
20
delete
[]
table
;
21
return
ret
;
22
}
24
25
27
int
myfunc
(
int
n
)
28
{
29
QVarLengthArray<int, 1024>
array
(
n
+ 1);
30
...
31
return
array
[
n
];
32
}
34
35
37
QVarLengthArray<int>
array
(10);
38
int
*
data
=
array
.data();
39
for
(
int
i
= 0;
i
< 10; ++
i
)
40
data
[
i
] = 2 *
i
;
i
i
[1]
Definition
doc_src_containers.cpp:169
array
QVarLengthArray< int > array(10)
[2]
myfunc
int myfunc(int n)
[0]
Definition
doc_src_qvarlengtharray.cpp:5
ret
return ret
Definition
qmacstyle_mac.mm:1046
data
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition
qopengles2ext.h:206
n
GLfloat n
Definition
qopengles2ext.h:795
array
GLenum array
Definition
qopenglext.h:7028
table
GLenum GLenum GLsizei void * table
Definition
qopenglext.h:2745
qtbase
src
corelib
doc
snippets
code
doc_src_qvarlengtharray.cpp
Generated by
1.10.0