The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Data Type Sizes

SercoSteveB
Active Participant

Following execution of the VI which of the files created is the largest.

NOTE:  Although the VI Snippet hasn't been created properly, the Cluster used in the top file write is supposed to contain 3 DBL numerics with values 1,2 and 3.

FileSizes.png

a) steve1.bin

b) steve2.bin

c) steve3.bin

d) steve4.bin

Comments
crossrulz
Knight of NI

Without running it, I would say B.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Asha_Nagaraj
Member

Ans is B

GayatriT
Member

With running it, I would say B.'

Array index will take 4 bytes, each element will take 8 bytes so here 3 elements are enabled so 8*3=24 bytes.  24+4=28 bytes

steve1.bin will take 4 bytes

steve2.bin will take 7 bytes

steve4.bin will take 8 bytes

faymia
Member

GayatriT says it all... The answer is B with 28 bytes.

crossrulz
Knight of NI

Except steve1.bin is actually 24 bytes.  It doesn't show in the picture, but the cluster actually has 3 doubles in it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
RAMESHB
Member

Ans  is B

swetha_sadula
Member

steve 2: 64*3=192 bits

steve 3: 8*3=24bits

steve 4:8*3+4=28bits

so answer:B

anybody will explain about option A?

crossrulz
Knight of NI

setha_sadula,

It is easier to do the math with bytes instead of bits.  Everything works in bytes anyways.  GayatriT states how it all goes down (except for not knowing there are 3 doubles in the cluster).

The cluster is just flat.  It will save the 3 doubles as normal doubles in the file.  So steve1.bin will be 24 bytes.

The gotcha in this question is that when saving arrays to a binary file, by default the length of the array is saved before the array.  That is an extra I32 (4 bytes).  So steve2.bin will actually be 28 bytes.

Each character in a string is 1 byte.  So a 3 character string (steve3.bin) will be 3 bytes plus the length prepended (4 bytes), making 7 bytes total).

The final option is just saving a double (8 bytes).  So steve4.bin will be 8 bytes.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
TG2
Member
Member

I have a question, I think this code does not run anyway. The Scan Value has 2 recommended input and only one is wired.

Ignore this, my answer is B

ashwinilele
Member

B

skian
Member

B