feat: ✨ Generate random value in the memory
This commit is contained in:
parent
ed935bba14
commit
01688bc12b
4
main.c
4
main.c
@ -1,10 +1,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
srand(time(NULL));
|
||||||
while (1) {
|
while (1) {
|
||||||
void* temp = malloc(1024);
|
void* temp = malloc(1024);
|
||||||
*((long int*) temp) = 1024;
|
*((long int*) temp) = rand();
|
||||||
if (temp == NULL) {
|
if (temp == NULL) {
|
||||||
printf("Memory is full\n");
|
printf("Memory is full\n");
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user