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: What is the output of this program?

    #include
    #include
    #include                              
 
    int main()
    {
        int ptr;
        ptr = (int)malloc(sizeof(int)*10);
        return 0;
    }
Answer: None of the mentioned options
                        
Question: What is the output of this program?

   #include
   #include
   struct st{
       int a;
       char b;
   };
 
   int main()
   {
       struct st *st_ptr;
       st_ptr = malloc(sizeof(struct st));
       printf("%d
",sizeof(struct st));
       return 0;
   }
Answer: 8
                        
Question: What is the output of this program?

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

   #include
   #include
 
   int main()
   {
       int *ptr;
       *ptr = 10;
       *ptr = 20;
       printf("%d
",*ptr);
       return 0;
   }
Answer: Segmentation fault
Question: In this program the allocated memory block can store 
    
    #include
    #include
 
    int main()
    {
        int *ptr;
        ptr = malloc(10);
        return 0;
    }
Answer: All of the mentioned options
                        
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