Search

Sponsored Links

Meta

Categories

Archives

Recent Posts

RSS Feeds

31
Oct

C/C++ Questions asked in various job interviews

Related Blog Items

C
==

-> volatile, static, const, register vars
-> Sections/Segments (text, data, stack, heap, bss, etc) of an ELF file
-> where various variables stored
local, formal vars: stack
  static,global (unintialised): bss (block start by symbol)
  static, global(initialised) : data section
  vars allocated thru malloc, new: heap

-> static linking (.a), dynamic linking and loading (.so)
-> Bitwise operations
-> swap two vars without using tmp var
  a=a+b; b=a-b; b= a-b;
u can also swap with using xor operations
  a^=b^=a^=b? (ofcourse this doesn’t work always as u expected, check the sequence point.. modify it)
-> calling conventions
info: c-calling convention, standard calling convention, pascal. etc. (this stuff specific windows,
  unix don’t bother about this, it just uses c calling convention)

->

C++

===
-> Difference between structure and class
-> access specifiers
-> Whats the size of an empty class
-> When do you use composition/aggregation and inheritance
-> When RTTI useful?
-> inline, macros
-> virtual polymorphism (abt vtables, vptrs also)
-> virtual destructors, why not virtual constructors
-> If u invoke a virtual function in constructor what will happen
-> How static behave in C++
-> Name mangling (all related issues like function overloading, using a C or other language function, etc)
-> oop concepts (just abstraction, encapsulation, inheritance, polymorphism)
-> copy constructors
-> “delete this”… is it advisable to use like this? is it useful in any situation?
-> what happens if an exception occurs in between construction of an object
-> If I link a library which I compiled on solaris with a linux executable, will it work?
  why?
-> difference between #define constants and enums
-> class
  {
   enum x{one, two}X1;
   enum y{one, two}Y1;
  };
  is this is OK?

Popularity: 27%

You need to log on to convert this article into PDF


Related Blog Items

No Comments

No comments yet.

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image