differences

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lakshmilalam
    New Member
    • Oct 2008
    • 1

    differences

    what is meant by object based programming and what are the main differences between object based and oops.
    - What are MACROS in 'C' and what is the use of it.
    - Can a function return any no of perameters?
  • arnaudk
    Contributor
    • Sep 2007
    • 425

    #2
    Originally posted by lakshmilalam
    what is meant by object based programming and what are the main differences between object based and oops.
    Sounds like two ways of saying the same thing to me.
    Originally posted by lakshmilalam
    - What are MACROS in 'C' and what is the use of it.
    Macros are instructions for the C preprocessor. They should be avoided because they circumvent a number of checks made by the compiler which protect the programmer from him/herself. They are there mainly for historical reasons but can occasionally be handy to change the way code is compiled, for example.
    Originally posted by lakshmilalam
    - Can a function return any no of perameters?
    Directly, no. Indirectly, yes. A function returns either nothing or a single value. That value may be a pointer to an array which can contain any number of variables. The array must then be declared outside the body of the function or in the function and on the heap or in the function and static (which is ugly).

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      Originally posted by arnaudk
      A function returns either nothing or a single value. That value may be a pointer to an array which can contain any number of variables. The array must then be declared outside the body of the function or in the function and on the heap or in the function and static (which is ugly).
      A function can return a structure ... but you shouldn't use that feature. Some compilers implement return of structures in a way that isn't thread-safe.

      Comment

      Working...