j
why doesmy code crash?
j
where
j
?
olli
struct tm *tv = {0};
tv -> tm_mday = day;
tv -> tm_mon= month-1;
tv -> tm_year= year;
dates[i++] = tv;
j
j
struct tm tv = {0};
tv.tm_mday = day;
tv.tm_mon= month-1;
tv.tm_year= year;
dates[i++] = &tv;
olli
You need to either define dates to be an array of structures (probably better solution) or need to allocate memory inside the door loop dynamically. In the later you need to make sure to free it in the end
j
i think i hava already done that
j
struct tm* dates[100];
j
@ollirz
j
it kinda works
j
however in the struct is stored a completely different date thank what i was expecting
j
i was expecting as year 2012
j
and i got 3912
j
solved
j
i just did year-1900
j
ty
Ravi
Thanks for your welcome
Ravi
👍
Jay
Hi
olli
Hi
Ludovic 'Archivist'
Ludovic 'Archivist'
Ludovic 'Archivist'
Linux is so non POSIX the only way to read the size of free memory requires you to... Allocate
BinaryByter
BinaryByter
dafaq?
Ludovic 'Archivist'
BinaryByter
Dima
BinaryByter
Hiii
BinaryByter
No we can't
BinaryByter
please read the rules of this caht
klimi
Mihail
Mihail
What happened to your name?
Mihail
And profile picture?
klimi
I was sad
klimi
And now I'm I'll af
Mihail
Finish your game
klimi
klimi
I'm in bed in pain....
Mihail
Oh
Mihail
Sad
klimi
Ye
Mihail
Wish you a fast recovery
klimi
Thanks
Shivam
Np
Dima
About Linux memory management... do they finally have a new syscall to get the real amount of ram usage instead of reading data from fd?
BinaryByter
JUST FUCKING TRY IT INSTEAD OF ASKING
Anonymous
guys
Anonymous
void func(char* string)
{
sprintf(string, "this is a test");
}
Anonymous
= *** stack smashing detected ***
Anonymous
char mystr[256];
func(&mystr);
Anonymous
never had this issue before
Anonymous
note: expected ‘char *’ but argument is of type ‘char (*)[256]’
Anonymous
wtf
Anonymous
ok fixed it
Anonymous
but srs
Anonymous
note: expected ‘char *’ but argument is of type ‘char (*)[256]’
Anonymous
what does gcc expect me to f*kin do
Anonymous
gfy gcc
Box of
Anonymous
aye clang never complains
Box of
Usually it gives more useful stuff
Anonymous
hey i want like a crc32 function
Anonymous
but i dont care about collisions
Anonymous
i just want really fast generation of obfusticated strings
Anonymous
which cant be unobfusticated
Anonymous
well they could be
Anonymous
but i dont care
Anonymous
its not important
Anonymous
input string as srand
Anonymous
duh
Box of
Anonymous
yeah