FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/integration_tests/bindc_02.py at main · Python51888/lpython · GitHub
Python51888
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
integration_tests
/
bindc_02.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (19 loc) · 590 Bytes
Breadcrumbs
lpython
/
integration_tests
/
bindc_02.py
Copy path
File metadata and controls
24 lines (19 loc) · 590 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from
lpython
import
c_p_pointer
,
CPtr
,
pointer
,
i16
,
Pointer
,
empty_c_void_p
from
numpy
import
empty
,
int16
,
array
queries
:
CPtr
=
empty_c_void_p
()
x
:
Pointer
[
i16
[:]]
=
c_p_pointer
(
queries
,
i16
[:],
array
([
1
]))
print
(
queries
,
x
)
def
f
():
yq
:
CPtr
=
empty_c_void_p
()
yptr1
:
Pointer
[
i16
[:]]
y
:
i16
[
2
]
=
empty
(
2
,
dtype
=
int16
)
y
[
0
]
=
i16
(
1
)
y
[
1
]
=
i16
(
2
)
yptr1
=
pointer
(
y
)
print
(
pointer
(
y
),
yptr1
)
print
(
yptr1
[
0
],
yptr1
[
1
])
assert
yptr1
[
0
]
==
i16
(
1
)
assert
yptr1
[
1
]
==
i16
(
2
)
yptr1
=
c_p_pointer
(
yq
,
i16
[:],
array
([
2
]))
print
(
yq
,
yptr1
)
f
()
Back
|
FazBrowse Home
|
New Git URL