hey I have been on this for a whole day. Why doesn't this even create the slucajni.bin file? This is C, not C++, I hope it is ok.
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#define BROJ_ZAPISA 20
int main (void){
FILE *iztok;
int i,n,br,j;
iztok = fopen("slucajni.bin","bw");
srand((unsigned) time(NULL));
for (i = 1; i <= BROJ_ZAPISA; ++i){
n=(rand() % 7) +2;
fwrite(&n,sizeof(n),1,iztok);
for(j=0;j<n;j++){
br=(rand()% 11) +150;
fwrite(&br,sizeof(br),1,iztok);
}
The mode string can also include the letter 'b' either as a last character or as a character between the characters in any of the two-character strings described above.