Last active
September 16, 2018 20:26
-
-
Save rohitx007/f28a05b717e30098a3816c19740b1957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
if(argc !=2){ | |
printf("Size of Memory \n"); | |
return 0; | |
} | |
long long int size = (long long int) atoi(argv[1]); | |
long long int sizeBytes = size*1024*1024; | |
int* array = malloc(sizeBytes); | |
int number = sizeBytes/(sizeof(int)); | |
int itr =0; | |
while(1){ | |
array[itr] = 0; | |
itr++; | |
if(itr>=number){ | |
itr=0; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment