Question Answer Tutorial Search
Home Search Add Question Linux Linux Basics File and Folder Environment Command Process

Memory

Shell Programming Mock Test Contact Feedback
Home
Search
Add Question
Linux
Linux Basics
File and Folder
Environment
Command
Process

Memory

Shell Programming
Mock Test
Subscribe/Unsubscribe
Email:
Social Media
Facebook

Misc Tutorials

References

Question and Answer Tutorial
Tutorials Point
Stack Overflow

Question Answer Tutorial - Linux->Memory

                        
First Previous 1 2 3 4 5 6 Next Last
Question: In which condition this prgram will print the string "MCQTutorial"?
   #include
   #include
 
   int main()
   {
       int *ptr;
       ptr = (int *)malloc(sizeof(int)*10);
       if (ptr == NULL)
           printf("MCQTutorial
");
       return 0;
   }
Answer: If the memory could not be allocated to the pointer&nbs
p;"ptr"
Question: What is the output of this program?

   #include
   #include
 
   int main()
   {
       int *ptr;
       ptr = (int *)malloc(sizeof(int));
       printf("%d
",*ptr);
       return 0;
   }
Answer: Undefined
                        
Question: What is the output of this program?

   #include
   #include
   #include                              
 
   int main()
   {
       char *ptr;
       ptr = (char*)malloc(sizeof(char)*11);
       strcpy(ptr,"MCQTutorial");
       printf("%d
",*ptr);
       return 0;
   }
Answer: 115
Question: What is the output of this program?

   #include
 
   int main()
   {
       int *ptr;
       ptr = (int *)calloc(1,sizeof(int));
       *ptr = 10;
       printf("%d
",*ptr);
       return 0;
   }
Answer: None of the mentioned options
Question: This program will allocate the memory of ___ bytes for pointer "ptr".

   #include
   #include
 
   int main()
   {
       int *ptr;
       ptr = realloc(0,sizeof(int)*10);
       return 0;
   }
Answer: 40
                        
                        
First Previous 1 2 3 4 5 6 Next Last
Comment:
Name:Email:
Contact No.:
Copyright © 2014 by SBJ Group. All Rights Reserved. Developed and maintained by SBJ Group. Supported on Internet Explorer browser only