Sunteți pe pagina 1din 7

3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

Search...

Home Aptitude Logical Verbal CA Current Affairs GK Engineering Interview Online Test Puzzles

C Programming :: Memory Allocation


Home » Engineering » C Programming » Memory Allocation » True / False Questions

Exercise :: Memory Allocation - True / False Questions


Memory Allocation - General Questions
Memory Allocation - Find Output of Program
Memory Allocation - Point Out Errors
Memory Allocation - Point Out Correct Statements
Memory Allocation - True / False Questions
Memory Allocation - Yes / No Questions

1. malloc() returns a float pointer if memory is allocated for storing float's and a double pointer if memory is
allocated for storing double's.
A.True
B.False

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.


Workspace

Report errors

https://www.indiabix.com/c-programming/memory-allocation/095001 1/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

...

Name :
Email:
Send Report
Online C Compiler

/* Note: GCC Compiler (32 Bit Linux Platform). */

#include<stdio.h>
int main()
{
printf("Weclome to IndiaBIX.com..!");
return 0;
}

Compile and Execute...


View Answer Discuss in Forum C Compiler Report

2. malloc() allocates memory from the heap and not from the stack.
A.True
B.False

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.


Workspace

Report errors
...

Name :
Email:
Send Report
Online C Compiler

https://www.indiabix.com/c-programming/memory-allocation/095001 2/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

/* Note: GCC Compiler (32 Bit Linux Platform). */

#include<stdio.h>
int main()
{
printf("Weclome to IndiaBIX.com..!");
return 0;
}

Compile and Execute...


View Answer Discuss in Forum C Compiler Report

3. malloc() returns a NULL if it fails to allocate the requested memory.


A.True
B.False

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.


Workspace

Report errors
...

Name :
Email:
Send Report
Online C Compiler

https://www.indiabix.com/c-programming/memory-allocation/095001 3/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

/* Note: GCC Compiler (32 Bit Linux Platform). */

#include<stdio.h>
int main()
{
printf("Weclome to IndiaBIX.com..!");
return 0;
}

Compile and Execute...


View Answer Discuss in Forum C Compiler Report

4. If malloc() successfully allocates memory it returns the number of bytes it has allocated.
A.True
B.False

Answer: Option B

Explanation:

Syntax: void *malloc(size_t size);

The malloc() function shall allocate unused space for an object whose size in bytes is specified by size and
whose value is unspecified.

The order and contiguity of storage allocated by successive calls to malloc() is unspecified. The pointer
returned if the allocation succeeds shall be suitably aligned so that it may be assigned to a pointer to any type
of object and then used to access such an object in the space allocated (until the space is explicitly freed or
reallocated). Each such allocation shall yield a pointer to an object disjoint from any other object. The pointer
returned points to the start (lowest byte address) of the allocated space. If the space cannot be allocated, a null
pointer shall be returned. If the size of the space requested is 0, the behavior is implementation-defined: the
value returned shall be either a null pointer or a unique pointer.
Workspace

Report errors

https://www.indiabix.com/c-programming/memory-allocation/095001 4/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

...

Name :
Email:
Send Report
Online C Compiler

/* Note: GCC Compiler (32 Bit Linux Platform). */

#include<stdio.h>
int main()
{
printf("Weclome to IndiaBIX.com..!");
return 0;
}

Compile and Execute...


View Answer Discuss in Forum C Compiler Report

Asianet Digital
Cable TV
50+ HD Channels. Sit Back
and Enjoy for a Wholesome
Experience
asianetdigital.co.in

https://www.indiabix.com/c-programming/memory-allocation/095001 5/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

Why buy TIP with SIP? Polymorphism - C# Typedef - C Hand and arm gestures
Programming Programming - Body Language
Questions and... Questions and Answers

Ad ICICI indiabix.com indiabix.com indiabix.com

Networking Questions Bitwise Operators - C Structures, Unions, Aptitude Questions and


and Answers Programming Enums Find Output of Answers
Questions and Answers Program - C...

indiabix.com indiabix.com indiabix.com indiabix.com

Read more:
Memory Allocation - Yes / No Questions

Current Affairs 2018

Interview Questions and Answers

https://www.indiabix.com/c-programming/memory-allocation/095001 6/7
3/13/2018 Memory Allocation True / False Questions - C Programming Questions and Answers

© 2009 - 2018 by IndiaBIX™ Technologies. All Rights Reserved. | Copyright | Terms of Use & Privacy Policy

Contact us: info-@-@indiab@ix.com Follow us on twitter!

https://www.indiabix.com/c-programming/memory-allocation/095001 7/7