Consider that my system has memory, but it is scattered in different places (fragmented). There are no four contiguous memory locations that are free. In that scenario, if I declare a character array of size 10 in the C language, what will happen ?
Consider that my system has memory, but it is scattered in different places (fragmented).
Share
If “my system has memory, but it is scattered in different places(fragmented)” means, that heap virtual memory is fragmented, and “declare a character array of size 10” means, that you create character array of size 10 in stack memory:
, then array will be successfully created.
If “declare a character array of size 10” means, that you allocate memory with malloc() (allocate in heap):
, then malloc() will return NULL.