Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Inexplicable behavior of file_write() #477890
08/12/19 11:59
08/12/19 11:59
Joined: Mar 2014
Posts: 13
B
Bernardo Offline OP
Newbie
Bernardo  Offline OP
Newbie
B

Joined: Mar 2014
Posts: 13
Hello, I'm desperate for banal storage.
Here is my code:

float N[12][60][12];
int filelength=60*12*12*4;
file_write("N.dat", N, filelength);

Seems to be right. But the file has only a size of 34 KB.

Does anyone have any idea what I'm doing wrong? Saving other files works!
Many thanks for your help

Forget it! Oh, dear, I got it!

Last edited by Bernardo; 08/12/19 15:01.
Re: Inexplicable behavior of file_write() [Re: Bernardo] #477895
08/12/19 18:42
08/12/19 18:42
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline
Junior Member
laz  Offline
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
please post the solution for other people with the same or similar problems wink

Re: Inexplicable behavior of file_write() [Re: Bernardo] #477898
08/12/19 19:08
08/12/19 19:08
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
For those wondering what the solution is, there was no problem. 60*12*12*4 = 34560, hence the 34 KB file.

But for aesthetic purposes, I would suggest writing it this way: sizeof(float)*12*60*12. This reads from left to right on the array declaration.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1