View Single Post
Old 05-30-2009, 06:46 AM   #2
yaustar's Avatar

Activity Longevity
1/20 19/20
Today Posts
0/11 sssss2317
Location: UK

Before advice, I am going to need a better idea of your ability, can you do this quick test?
* What is the difference between between a const global variable and a #define? Where would you use one over the other?

* Difference between:
const int * const foo
const int * foo
int * const foo

* What is the difference between a recursive function and loops? Give an example of each.

* Write a bubble sort function
void BubbleSort (int * IntArray, const unsigned int ArraySize)

* What errors would occur in the following code and why?

class Blah
int Foo;

Blah() { Foo = 10; }
~Blah() {}
MyFunction ( int &Mobor)
Mobor += 10;

int main( int argc, char **argv)
Blah * ptr = 0;
return 0;

* What does a static variable do in a function?

* What is a ring buffer and how does a it differ from a standard queue?

* What does "in place" mean (regarding algorithms)? Give an example.

* What are the differences between an Octree, Quadtree and a BSP? What can they be used for?

* Optimise this function:
const int Sum (const int * LotsOfNumbers, const unsigned int Size )
int Sum = 0;

for(int i = 0; i < Size; ++i)
Sum += LotsOfNumbers[i];

return Sum;

* The difference between ++i and i++;

* Describe a use of a function pointer and suggest other methods to produce the same effect.

* What is a template class? What an example that stores an object with a function that squares itself returning the object as a const. Give an example why this would not work with all objects.

* What is the difference between an Interface class and an Abstract class?

* What is wrong with the following piece of code and how would you fix it? What would be the result of the error and why?

class A
int *AInt;
A() { AInt = new int(0); }
~A() { delete AInt; }

class B : public A
int *BInt;
B() { BInt = new int(0); }
~B() { delete BInt; }
yaustar is offline   Reply With Quote