Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mytests
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songxinkai
mytests
Commits
89b3b291
Commit
89b3b291
authored
Jan 10, 2019
by
SongXinkai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20190110, modify go_data_write_example
parent
a35b85a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
.gitignore
+1
-0
c++file/binary_read_write/main.cpp
+2
-2
No files found.
.gitignore
View file @
89b3b291
*core
*a.out
.*.swp
c++file/binary_read_write/main.cpp
View file @
89b3b291
...
...
@@ -46,7 +46,7 @@ void read(const string file, vector<vector<float> >& feas,
void
write
(
const
string
file
){
int
steps_out
=
400
;
float
winner_out
=
1.0
;
int
winner_out
=
1
;
// 1: black win, 0: white win
unsigned
char
feas_out
[
400
*
17
*
19
*
19
]
=
{
0
};
float
pis_out
[
400
*
362
]
=
{
0.0
};
srand
((
int
)
time
(
0
));
...
...
@@ -71,7 +71,7 @@ void write(const string file){
}
std
::
ofstream
output
(
file
,
ios
::
out
|
ios
::
binary
);
output
.
write
((
char
*
)
&
steps_out
,
sizeof
(
int
));
output
.
write
((
char
*
)
&
winner_out
,
sizeof
(
floa
t
));
output
.
write
((
char
*
)
&
winner_out
,
sizeof
(
in
t
));
output
.
write
((
char
*
)
feas_out
,
sizeof
(
char
)
*
19
*
19
*
17
*
steps_out
);
output
.
write
((
char
*
)
pis_out
,
sizeof
(
float
)
*
(
19
*
19
+
1
)
*
steps_out
);
output
.
close
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment