FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ByteConvert_cpp/examples/bytes_to_int.cpp at master · fcccode/ByteConvert_cpp · GitHub
fcccode
/
ByteConvert_cpp
Public
forked from
SloCompTech/ByteConvert_cpp
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
ByteConvert_cpp
/
examples
/
bytes_to_int.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 496 Bytes
Breadcrumbs
ByteConvert_cpp
/
examples
/
bytes_to_int.cpp
Copy path
File metadata and controls
21 lines (17 loc) · 496 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
#
include
<
cstdint
>
#
include
<
cstring
>
#
include
<
ByteConvert/ByteConvert.cpp
>
int
main
()
{
//
Create array of bytes that represent 1 (type: int)
uint8_t
block[
sizeof
(
int
)];
memset
(block,
0
,
sizeof
(
int
)-
1
);
block[
sizeof
(
int
)-
1
] =
1
;
int
val = ByteConvert::to_variable<
int
>(block);
//
Convert array of bytes to int
if
(val !=
1
) {
//
Check if we got, what we expected to get
//
Error, something went wrong
return
-
1
;
}
//
Success
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL