Saturday 7 May 2011

C++ developer interview questions

  1. Will the following program execute?void main()
    {
    void *vptr = (void *) malloc(sizeof(void));
    vptr++;
    }
  2. How about this one?
    void main()
    {
    char *cptr = 0?2000;
    long *lptr = 0?2000;
    cptr++;
    lptr++;
    printf(” %x %x”, cptr, lptr);
    }
    Will it execute or not?
  3. When the processor wakes up after power on, it goes to a particular memory location. What is that memory location called?
  4. What is the difference between Mutex and Binary semaphore?
  5. Write a program to set 2nd bit in a 32 bit register with memory location 0×2000?

Search here for "Freshers Jobs"