Else statement is connected to the if statement. Once the if statement is executed, else statement is not executed even if the while statement inside the if returns false or true or never returns.

Royal blue, bought my first car last summer. 2007 tiburon GT. Sexy little self. Got it for a bargin too. 21K miles for 8G.

Member functions are not the same as regular functions. There is a little more work, here is an example:

class SampleClass
    int plusfunc (int a, int b);

int SampleClass :: plusfunc (int a, int b)
    return a + b;

typedef int (SampleClass::*functor3) (int a, int b);

int main(){
 SampleClass sc;
 functor3 f[1] = {&SampleClass::plusfunc};
//note you need an object to call the function that f points to
 cout << (sc.*f[0])(1,1) << endl;
 return 0;


Your code seems fine, it might be how you setup the environment. How'd you set up your environment? I haven't used netbeans in years. But typically in any ide, there is an option to create a C++ project. Did you try to run a simple hello-world program and see if that works:

#include <iostream>
using namespace std;
int main(){
  cout << "TEST" << endl;
  return 0;

Is that function a virtual function, can you change its sigs? Why not return a std::pair<bool,Handle> ?

if(Clock.GetTime() >= FPS){

Why do you do Clock.start() here again? A better way to handle it is like so:

if(Clock.GetTime() >= FPS){
    Clock::TimeDiff diffTime = Clock.GetTime() - FPS;

Check out a full tutoial here

while (v[i] < 2147483648 && v[i] > -2147483647)

I have no words...except this sentence.

If you don't know the size of the parameter 'a' in your example, then it is not possible to correctly write the needed logic with the given information. Sure we can assume things such as the char array is null terminated which is a natural assumtion in this case, but its still an assumption.

Your asking for private code. I told you what I was doing.

Welp for one calm that attitude down. Second good luck with your problem then.

post more code

Somthing like this perhaps

template<typename FirstContainer, typename SecondContainer, typename BinaryOp>
void iterateTwoContainer(const FirstContainer& firstList,
                         const SecondContainer& secondList,
                         const BinaryOp op2){
 for(int i = 0; i < firstList.size(); ++i){
   for(int j = 0; j < secondList.size(); ++j){

void handleItemAndToys(const Item1& item, const Toy& toy){/*...*/}
void handleItemAndApples(const Item2& item,const Apple& apple){ /*...*/}
int main(){

myk45 commented: thanks! +5
// Append element to array
template <class eltType> Array<eltType> &Array<eltType>::operator+=(eltType elt, const Array<eltType> &A)
    if (A.itemsUsed() != A.size())
        elements[A.itemsUsed() + 1] = elt;
    else if (A.itemsUsed() == A.size())
        eltType *temp=new eltType[capacity+1];

        for (int i = 0; i < size(); ++i)


        delete [] elements;



Oh man this is a pretty confusing operator. Consider just renaming it .push_back or something. Also your problem is that itemAmt isn't being initialzed inside your constructor.

Initialize you letter grades.

 char A('A'), B('B'), C('C'), D('D'), E('E'), F('F');


Some bullshit I can think of are ...

- Better design
- Cleaner Interface
- Great Client Usability
- More stuff about good design, usability, accessability...

Go for sfml, but there might be more documentation on sdl. Check out gamedev, they are generally good with helping with graphics. Or you can post here and we'll help as well. Just get some simple screen gonig on sfml then move on further from there.

You listed the answer, 1 = 5 therefore 5 = 1.

Sometimes simplicity is overlooked.

Either manually make sure the vector size isn't correct, or use an static array, or inherit from vector and make the resize function private.

Another option is to make a File struct.

struct FileInfo{
    std::string name;
    //possibly other things
    explicit FileInfo(const std::string& name = ""): name(name){}

class Lexical{
     ReturnType read(const std::string& sentence);
     ReturnType read(const FileInfo& fileInfo);

but I suggest to go the istream route as suggested in previous post.

You're looking for conversion operator. Something like

class Point{
    int x,y;
    operatir POINT()const{
       return POINT(x,y);
triumphost commented: Perfect! I never ever saw that before. Thank you. +5

How could one insert new elements in the vector ?

By using std::vector::push_back or std::vector::insert function

Would it be a good idea to create the vector within the class / the constructor?

Sure, if you need an array of something, then std::vector is usually a good choice.

Please reformat your code. What is the problem you are having?

glTranslate translate the current view matrix, not just one object. So it can be used for different things

[QUOTE=WaltP;1781807]Depends on the compiler I suppose...[/QUOTE]

Idk, maybe someone more knowledgeable can comment. I haven't seen one implementation that uses a list, simply because calculating at runtime is very fast and way less memory intensive than generating a list of pseudo random numbers, which can be very very long.

[b]Random numbers are not calculated, they are pulled from a huge list[/b]

Are you sure? I thought they were calculated via [URL="http://en.wikipedia.org/wiki/Linear_congruential_generator"]linear congruential algorithm[/URL] given a seed to start from.

You probably forgot to seed it. Try this:


using namespace std;

int main(){
srand( time(0) ); //seed the RGN
for(int i = 0; i < 10; ++i){
std::cout << (rand() % 100 + 1) << std::endl;
return 0;

[QUOTE=CodeNinjaMike;1780255]Ok so what I need to do is take the key and find the value in the array that matches the key and replace it there. But wouldn't I still have to move the data over to the right and insert the new data into the empty spot?[/QUOTE]

Key should be unique to each hashtable. So every key of value 5 for example, should map to the same spot in the array.

No all you need is a insert function. Usually what happens is that if you try to insert into the map with a key that already exist you return the already existed key/value pair. It is up to the user to decide whether to remove that key or just replace the value associated with that key

why do you have that? A key should be unique. In your insert function you are shifting values around. That would cause the get method to fail or act incorrectly because a key that was hashed into a slot is no longer in the same slot.

why do you have both "put" and "insert" function? Most likely, you should only have one function to insert into the hashmap.