K

6 posts

K

K

@KrugerrandK

Katılım Ekim 2011
30 Takip Edilen5 Takipçiler
K
K@KrugerrandK·
@Aspie96 @vikhyatk Yes I see but that's the point of the C standard. They didn't allow it for the reason that you should wonder outside of the bounds of an array or variable. In your example, regular index access should be used. But I understand your point completely.
English
1
0
0
20
Valentino Giudice
Valentino Giudice@Aspie96·
@vieuxbizzard @vikhyatk This is perfectly fine under naive assumptions and will likely work most times in practice, but it's technically not allowed, it's UB. I think C would be better if the natural obvious assumptions by which this code would be correct were part of the language.
English
1
0
0
29
vik
vik@vikhyatk·
there's something really elegant about c programming that no other language has managed to replicate
English
24
9
186
11.7K
K
K@KrugerrandK·
@Aspie96 @vikhyatk Yes indeed. But for the matrix, it is still considered having sub arrays. Meaning for a mat of 3 subarrays you can only do p+1 at three occasions Even if in memory p+1 of the first subarray points to first element of the next subarray you won't be allowed to dereference it.
English
1
0
0
18
Valentino Giudice
Valentino Giudice@Aspie96·
@vieuxbizzard @vikhyatk It is undefined behavior to even compute an invalid pointer unless it's NULL or a valid pointer + 1. Even if you do not access that pointer, ever. This can actually happen in some cases (for example reading a column of a linearized matrix).
English
1
0
0
25
K
K@KrugerrandK·
@Aspie96 @vikhyatk &a + 100 doesnt make sense from a logical point of view, even if the CPU technically allows it why would ou go out of the bounds of the variable a? The C standard defined this rule.
English
1
0
0
44
Valentino Giudice
Valentino Giudice@Aspie96·
@vikhyatk int a = 5; int *b = (&a + 100) - 100; printf("%d\n", *b); What does this code do? Exactly! We can't know, it's undefined behavior. How very elegant.
English
2
0
0
133
K
K@KrugerrandK·
@Seaiter @LukasMau__ Oui oui c'est tout à fait intentionnel dans Windows : il utilise l'excédent RAM pour mettre en cache / précharger des données et des fichiers afin d'améliorer les performances etc.. même quand le PC ne fait rien.
Français
0
0
0
26
Seaiter
Seaiter@Seaiter·
@vieuxbizzard @LukasMau__ Donc pour toi c'est normal d'utiliser minimum 40% de la Ram disponible (Peut importe le nombre de Go que tu as) ? quand tu ne lance aucun gros logiciel ou jeux😅
Français
1
0
0
34
K
K@KrugerrandK·
@Seaiter @LukasMau__ Non justement là c'est normal, ça ne sert a rien de ne pas utiliser de la RAM quand tu en as beaucoup de disponible.
Français
1
0
0
25
Seaiter
Seaiter@Seaiter·
@LukasMau__ Dit toi, que même avec 32Go de mon côté, je sature très vite la RAM (Juste avec un seul logiciel ou un jeu lourd) 😅 Windows 11 c'est une catastrophe pour la gestion de la RAM
Français
1
0
0
59
K
K@KrugerrandK·
@cysky0x1 just exploit it instead of trying to get recognition for $0
English
1
0
40
6.5K
Abdelhy khaled🦅
Abdelhy khaled🦅@cysky0x1·
Mastercard has been hacked successfully via a critical vulnerability. 🧘 Mission complete 💯🏂
Abdelhy khaled🦅 tweet media
English
12
31
1.8K
106.3K